Set php environment variables windows

I am using WAMP. I want to use php from the command prompt. What is the entry in PATH env variable for this ?

Boris Guéry

46.8k7 gold badges51 silver badges87 bronze badges

asked Apr 29, 2010 at 10:26

1

You need to add the PHP directory to your path. On the command line (e.g. in a batch file), it would look like this:

SET PATH=%PATH%;C:\your\wamp\path\php

if in doubt, it's the directory containing the php.exe.

You can also pre-set the path in Windows' control panel. See here on how to do this in Windows 7 for example.

Be aware that if you call the PHP executable from an arbitrary directory, that directory will be the working directory. You may need to adjust your scripts so they use the proper directories for their file operations (if there are any).

answered Apr 29, 2010 at 10:31

PekkaPekka

434k137 gold badges964 silver badges1077 bronze badges

1

Follow this for Windows operating system with WAMP installed.

System > Advanced System Settings > Environment Variables Click new Variable name : path Variable value : c:\wamp\bin\php\php5.3.13\ Click ok

answered Mar 24, 2014 at 11:03

MukeshMukesh

7,49920 gold badges105 silver badges152 bronze badges

You need to put the directory that has php.exe in you WAMP installation into your PATH. It is usually something like C:\wamp\xampp\php

answered Apr 29, 2010 at 10:29

codaddictcodaddict

434k80 gold badges487 silver badges524 bronze badges

2

For windows: Go to your "system properties" please.then follow as bellow.

Advanced system settings(from left sidebar)->Environment variables(very last option)->path(from lower box/system variables called as I know)->edit

then concatenate the "php" location you have in your pc (usually it is where your xampp is installed say c:/xampp/php)

N.B : Please never forget to set semicolon (;) between your recent concatenated path and the existed path in your "Path"

Something like C:\Program Files\Git\usr\bin;C:\xampp\php

Hope this will help.Happy coding. :) :)

answered Jun 4, 2016 at 17:13

SakilSakil

8931 gold badge9 silver badges18 bronze badges

You May use set keyword for set the path

set path=%path%;c:/wamp/bin/php/php5.3.0

if all the path are set in path variables

If you want to see all path list. you can use

set %path%

you need to append your php path behind this path.

This is how you can set environment variable.

answered Oct 2, 2013 at 13:34

Nikunj K.Nikunj K.

8,2714 gold badges40 silver badges51 bronze badges

It depends on your OS, but if you are on Windows XP, you need to go to Systems Properties, then Advanced, then Environment Variables, and include the php binary path to the %PATH% variable.

Locate it by browsing your WAMP directory. It's called php.exe

answered Apr 29, 2010 at 10:29

Boris GuéryBoris Guéry

46.8k7 gold badges51 silver badges87 bronze badges

Try display phpinfo() by file and check this var.

answered Apr 29, 2010 at 10:33

KamilosKamilos

7652 gold badges10 silver badges25 bronze badges

Not the answer you're looking for? Browse other questions tagged php windows wamp or ask your own question.

Where are PHP Environment Variables set?

Using Environment Variables in PHP.
PHP environment variables allow your scripts to glean certain types of data dynamically from the server. ... .
You can access these variables using the $_SERVER and $_ENV arrays..
/home/00000/domains/example.com/html..
Create a phpinfo..

Does PHP have an environment PATH variable?

Add PHP Environment Variable Open the Control Panel -> System and Security Settings -> System. Click on Advanced system settings. Click on the Environment Variables button. Under System Variables select the Path variable and click the `Edit` button.

How do I add my PHP directory to the path on Windows?

How do I add my PHP directory to the PATH on Windows?.
Go to Control Panel and open the System icon (Start → Control Panel).
Go to the Advanced tab..
Click on the 'Environment Variables' button..
Look into the 'System Variables' pane..
Find the Path entry (you may need to scroll to find it).
Double click on the Path entry..

How do I set Environment Variables in Windows?

On the Windows taskbar, right-click the Windows icon and select System. In the Settings window, under Related Settings, click Advanced system settings. On the Advanced tab, click Environment Variables. Click New to create a new environment variable.

Chủ đề