简体   繁体   English

PHP仅在某些文件夹的CMD中可用

[英]Php only available in CMD from certain folders

For some reason I can only access php from certain cmd windows. 由于某些原因,我只能从某些cmd Windows访问php Namely from doing wndKey+R then typing in cmd . 即从执行wndKey+R然后输入cmd

Inside this folder php will run as expected. 在此文件夹中, php将按预期运行。 However opening cmd anywhere else and it'll return 但是在其他任何地方打开cmd都会返回

'php' is not recognized as an internal or external command,  
operable program or batch file.

It is added to my path correctly. 它已正确添加到我的路径。 Not sure why I would get this error... :/ 不知道为什么我会收到此错误...:/

The most likely reason for this is that php is not located on your path environment variable. 造成这种情况的最可能原因是php不在您的path环境变量中。

Go to Control Panel -> Advanced System Settings -> Environment Variables -> Path -> Edit , then make sure that the folder containing php is located in the path variable. 转到Control Panel -> Advanced System Settings -> Environment Variables -> Path -> Edit ,然后确保包含php的文件夹位于path变量中。 If it is not, append it to the end of the path variable. 如果不是,请将其附加到path变量的末尾。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM