Jump to content

[SOLVED] PHP CLI Windows Environment Variable?


AbydosGater

Recommended Posts

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

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.

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 :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.