Skip to main content

How to include php.exe directory path in system variables path



Hi guys,
Have you tried this command?


I was really frustrated when I have to call php cli (the red line) with its directory. As you can see in the image above, I’m accessing the fuelphp’s command line utility named “oil”. In my case, my folders and directories are arranged well and thus, additional folders needed to cluster them all (somewhat like a library) like the image bellow.


So that means I have to access php cli and fuelphp in this a long line of text:

C:\> cd c:\wamp\bin\php\php5.3.13\
C:\wamp\bin\php\php5.3.13>php c:\wamp\www\PATH_1\ PATH_2\ PATH_3\ PATH_4\ PATH_5\fuelphp\oil

To address this problem, samsami2u shares his knowledge. Here’s how

Step 1


Go to your “Computer Icon” and right-click. Press “Properties”

 Step 2

 On the “Control Panel Home” click “Advanced System Settings”


Step 3


 A “System Properties” window will pop-up. It will a automatically select the “Advanced” Tab. Then click “Environment Variables”


 Step 4


The “Environment Variables” window will pop-up. Click or select “TMP” (blue highlighted) under “User Variables” and select “Path” (Green highlighted) under “System variables” combo box. And finally click “Edit” (Circled Red).

 Step 5


 On the “Edit System Variables” window, click the textbox beside “Variable value”. We will put the php.exe’s folder path in here.

Step 6



In my case I’m using WAMP Server 2.2. My defaults PHP-CLI path is “C:\wamp\bin\php\php5.3.13” (Blue highlighted) . Copy that link.

Step 7



Before you paste the link, add first a semi-colon first “ ; ” at the end. It’s a separator between other existing paths. And finally, press “OK” to complete. And Then “Restart” the computer to apply these effects.

Please note that if you access the PHP-CLI aside from its root directory, it will not be recognize by default.

To check if it is working. Open up your cmd and type this command.

php –version


Now I can run any CLI provided by the PHP Frameworks



Conclusion
And now were done. We manage to add the directory of PHP-CLI (php.exe). we can now call it every were in the folder using command prompt without including the full directory of PHP-CLI.
Before I end this, (as of this writing, php 5.4 is on its way to release) please take note that if you update your Wamp Server,
You must also change the path directory in “system variable”.


You Can Download this PDF File HERE

Comments

Popular posts from this blog

How to create and merge a twin photo of yourself in Gimp.

How to create and merge a twin photo of yourself in Gimp. By Benjie Dagunan
Hello! this will be my first post. as you can see, there's nothing yet to be read. but sooner or later i will be posting some of my works. but for now i will just leave with this web design. A simple mock-ups created inkscape