简体   繁体   English

php未被识别为内部命令(在Windows中)

[英]php is not recognized as an internal command (in Windows)

I want to develop using a framework called Symfony but I do not have a Mac and I don't want to dual boot with Debian. 我想使用一个名为Symfony的框架开发,但我没有Mac,我不想用Debian进行双启动。

I tried virtual hosts via Virtual Box but it doesn't work. 我通过Virtual Box尝试了虚拟主机,但它不起作用。 So I decided to stay on Windows. 所以我决定留在Windows上。

So when the tutorial tells me to do 所以当教程告诉我这样做时

php lib/vendor/symfony/data/bin/check_configuration.php

i do in the windows cmd : 我在windows cmd中做:

php lib\vendor\symfony\data\bin\check_configuration.php

and it tells me: 它告诉我:

'php' is not recognized as an internal or external command 'php'不被识别为内部或外部命令

I use UwAmp (php 5.2.12 + mysql + apache) which is stored in 我使用存储的UwAmp(php 5.2.12 + mysql + apache)

E:\logiciels\UwAmp\

inside I have bunch of files, but I guess that is important: 我有一堆文件,但我想这很重要:

E:\logiciels\UwAmp\apache\php_5.2.11

How to make the cmd PHP in the windows cmd work properly? 如何使Windows cmd中的cmd PHP正常工作?

You'll have to add the directory in which the php executable is located to your "path" variable (I guess in your case that would be E:\\logiciels\\UwAmp\\apache\\php_5.2.11 ). 你必须将php可执行文件所在的目录添加到你的“path”变量中(我猜你的情况是E:\\ logiciels \\ UwAmp \\ apache \\ php_5.2.11)。 In Windows, you can do that as described here: http://www.computerhope.com/issues/ch000549.htm 在Windows中,您可以按照此处的说明执行此操作: http//www.computerhope.com/issues/ch000549.htm

Any directory you place in this path variable (they're separated by a semicolon) will be automatically used in, for example, a cmd shell. 您放在此路径变量中的任何目录(它们用分号分隔)将自动用于(例如)cmd shell。

You need to add the path where the binary resides in to the PATH variable. 您需要将二进制所在的路径添加到PATH变量中。 You can do this on XP and Win 7 under the System -> User settings -> User variables 您可以在系统 - >用户设置 - >用户变量下的XP和Win 7上执行此操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 php无法识别为内部或外部命令 - php is not recognized as an internal or external command PHP 在命令提示符中未被识别为内部或外部命令 - PHP is not recognized as an internal or external command in command prompt 'composer' 在 windows 服务器中未被识别为内部或外部命令 - 'composer' is not recognized as an internal or external command in windows server 'php'在终端中不被识别为内部或外部命令 - 'php' is not recognized as an internal or external command in terminal php 未被识别为使用 xampp 的内部或外部命令 - php is not recognized as an internal or external command using xampp PHP:'java'不被识别为内部或外部命令 - PHP: 'java' is not recognized as an internal or external command php.exe无法识别为外部或内部命令 - php.exe is not recognized as an external or internal command 'php' 不被识别为内部或外部命令,可操作 - 'php' is not recognized as an internal or external command, operable MAMP 'php' 不被识别为内部或外部命令 - MAMP 'php' is not recognized as an internal or external command Windows-PHP-'bin \\ behat'不被识别为内部或外部命令,可操作程序或批处理文件 - Windows - PHP - 'bin\behat' is not recognized as an internal or external command, operable program or batch file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM