I am using WAMP. I want to use php from the command prompt. What is the entry in PATH env variable for this ?
我用里面。我想从命令提示符中使用php。路径env变量的输入是什么?
7 个解决方案
#1
5
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
您需要放置有php的目录。在你的路径中安装exe。它通常类似于C:\wamp\xampp\php
#2
78
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:
您需要将PHP目录添加到路径中。在命令行(例如在批处理文件中),它看起来是这样的:
SET PATH=%PATH%;C:\your\wamp\path\php
if in doubt, it's the directory containing the php.exe
.
如果有疑问,它是包含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.
您还可以在Windows的控制面板中预先设置路径。请看这里,如何在Windows 7中实现这一点。
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).
请注意,如果从任意目录调用PHP可执行文件,该目录将是工作目录。您可能需要调整脚本,以便它们使用适当的目录来进行文件操作(如果有的话)。
#3
13
Follow this for windows operating system
windows操作系统也是如此
System>Advanced System Settings>Environment Variables
Click new
Variable name : path
Variable value : c:\wamp\bin\php\php5.3.13\
Click ok
#4
4
You May use set
keyword for set the path
您可以使用set关键字来设置路径。
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.
您需要在此路径后面添加php路径。
This is how you can set environment variable.
这就是设置环境变量的方法。
#5
2
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.
这取决于您的操作系统,但是如果您使用Windows XP,您需要访问系统属性,然后是高级,然后是环境变量,并包含到% path %变量的php二进制路径。
Locate it by browsing your WAMP directory. It's called php.exe
通过浏览WAMP目录找到它。它被称为exe
#6
2
Try display phpinfo() by file and check this var.
尝试通过文件显示phpinfo()并检查这个var。
#7
2
For windows: Go to your "system properties" please.then follow as bellow.
windows:请转到“系统属性”。然后详见下表。
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)
然后连接您的pc中的“php”位置(通常是安装xampp的地方,例如c:/xampp/php)
N.B : Please never forget to set semicolon (;) between your recent concatenated path and the existed path in your "Path"
N。B:请不要忘记在最近连接的路径和“路径”中存在的路径之间设置分号(;)
Something like C:\Program Files\Git\usr\bin;C:\xampp\php
类似C:\Program Files\Git\usr\本;C:\ xampp \ php
Hope this will help.Happy coding. :) :)
希望这将帮助。快乐的编码。:):)
#1
5
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
您需要放置有php的目录。在你的路径中安装exe。它通常类似于C:\wamp\xampp\php
#2
78
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:
您需要将PHP目录添加到路径中。在命令行(例如在批处理文件中),它看起来是这样的:
SET PATH=%PATH%;C:\your\wamp\path\php
if in doubt, it's the directory containing the php.exe
.
如果有疑问,它是包含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.
您还可以在Windows的控制面板中预先设置路径。请看这里,如何在Windows 7中实现这一点。
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).
请注意,如果从任意目录调用PHP可执行文件,该目录将是工作目录。您可能需要调整脚本,以便它们使用适当的目录来进行文件操作(如果有的话)。
#3
13
Follow this for windows operating system
windows操作系统也是如此
System>Advanced System Settings>Environment Variables
Click new
Variable name : path
Variable value : c:\wamp\bin\php\php5.3.13\
Click ok
#4
4
You May use set
keyword for set the path
您可以使用set关键字来设置路径。
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.
您需要在此路径后面添加php路径。
This is how you can set environment variable.
这就是设置环境变量的方法。
#5
2
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.
这取决于您的操作系统,但是如果您使用Windows XP,您需要访问系统属性,然后是高级,然后是环境变量,并包含到% path %变量的php二进制路径。
Locate it by browsing your WAMP directory. It's called php.exe
通过浏览WAMP目录找到它。它被称为exe
#6
2
Try display phpinfo() by file and check this var.
尝试通过文件显示phpinfo()并检查这个var。
#7
2
For windows: Go to your "system properties" please.then follow as bellow.
windows:请转到“系统属性”。然后详见下表。
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)
然后连接您的pc中的“php”位置(通常是安装xampp的地方,例如c:/xampp/php)
N.B : Please never forget to set semicolon (;) between your recent concatenated path and the existed path in your "Path"
N。B:请不要忘记在最近连接的路径和“路径”中存在的路径之间设置分号(;)
Something like C:\Program Files\Git\usr\bin;C:\xampp\php
类似C:\Program Files\Git\usr\本;C:\ xampp \ php
Hope this will help.Happy coding. :) :)
希望这将帮助。快乐的编码。:):)