AbydosGater Posted July 4, 2007 Share Posted July 4, 2007 Hey Guys, I recently had to uninstall Apache2Triad due to problems with PHP on the command line. I now have WAMPserver installed and everything looks to be going good. One question i hope someone could help me with. When i was using A2T, "PHP" was a recognised command for cmd. But now that it is uninstalled it is not. IE: To run a php script i just had to type "php c:\path\2\file.php" and it would run the file. Now thats not working.. Would anyone know how i could add that back into the System so it would work again? Thanks, Andy Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 4, 2007 Share Posted July 4, 2007 You'll need to add the php folder to the Windows PATH variable Start > Control Panel > System > Advanced tab > Environment Variables Select the PATH from the system environment variables box and press edit button. Press the End key on your keyword now type ;C:/wamp/php; (NOTE: DO NOT DELETE ANYTHING THAT IS ALREADY SET) Click Ok on all remaining windows. Now restart Windows for Windows to apply the changes made. Open up a command prompt php should now be recognised. Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 4, 2007 Author Share Posted July 4, 2007 Hey Wildteen88 Thanks for another fast great answer, Will test this now! Restarting! Andy Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 4, 2007 Author Share Posted July 4, 2007 Hey back up and running! Yes Yay wildteen your Great! Thank you so much Just one other problem im getting now. I will post here instead of posting a whole new topic. Most of my dev scripts i just use short opening tags (<? and ?>) .. And in my NEW php.ini file i have: short_open_tag = On But even with that done and all apache and other services restarted.. Im when i run my script via command line it just displays the code not actually runs the script. When i change the <? to <?php on one of my scripts everything runs fine.. But i cant go through hundreds of testing files to change them all.. Anyone know why this is happening? UPDATE: Short opening tags are working Via browser just not command line where i need them Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 4, 2007 Share Posted July 4, 2007 find -name '*.php' -exec grep '<?[^p=]' {} ; Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 4, 2007 Author Share Posted July 4, 2007 Thanks Redarrow.. Where do i find this? Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 4, 2007 Share Posted July 4, 2007 what do you mean from my brain Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 4, 2007 Author Share Posted July 4, 2007 Lol, Right well what exactly do i do with "find -name '*.php' -exec grep '<?[^p=]' {} ;"? Quote Link to comment Share on other sites More sharing options...
trq Posted July 4, 2007 Share Posted July 4, 2007 The code eedarrow posted is written for Linux and doesn't actually do anything but display <?php if found in your php file. Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 4, 2007 Author Share Posted July 4, 2007 Oh ok, well does anyone know how to fix my problem? Quote Link to comment Share on other sites More sharing options...
trq Posted July 4, 2007 Share Posted July 4, 2007 I think you'll find the cli usually has its own php.ini. See if you can find it by typing.... php -i at a prompt. PS: It would be a good idea to get in the habbit of using the proper <?php tags from now on. Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 4, 2007 Author Share Posted July 4, 2007 Hey Thorpe. Yay thanks found it and all fixed now! Yes i know, its just all my own small scripts i know will be able to run on my server that i just use <?.. everything else is <?php Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.