PHP 环境变量


PHP Environment Variables

我不确定为什么我仍然得到PHP不被识别为内部或外部命令错误。这是我的环境变量:

C:'Program Files (x86)'NVIDIA Corporation'PhysX'Common;C:'Program Files'Common Files'Microsoft Shared'Windows Live;C:'Program Files (x86)'Common Files'Microsoft Shared'Windows Live;%SystemRoot%'system32;%SystemRoot%;%SystemRoot%'System32'Wbem;%SYSTEMROOT%'System32'WindowsPowerShell'v1.0';C:'Program Files (x86)'Windows Live'Shared;C:'Program Files (x86)'EgisTec MyWinLocker'x64;C:'Program Files (x86)'EgisTec MyWinLocker';C:'Program Files'Intel'WiFi'bin';C:'Program Files'Common Files'Intel'WirelessCommon';C:'strawberry'c'bin;C:'strawberry'perl'site'bin;C:'strawberry'perl'bin; C:'PHP';

我的 PHP.exe 位于"C:''PHP''"中,所以我不确定为什么我会收到此错误。

我没有

Windows机器来验证这一点,但是我很确定;分隔符后不能有空格。 去掉C:'PHP前的空格,可能无害,还要去掉尾随'

C:'Program Files (x86)'NVIDIA Corporation';...snip...;C:'strawberry'perl'bin;C:'PHP
-------------------------------------------------------------------------^^^^^

根据您启动 PHP 的方式,您可能需要注销 Windows 并重新登录以在您的环境中传播新%PATH%,尽管我怀疑这是必要的。

只尝试:C:''PHP(不带最后一个'''')。保存更改后,重新启动计算机并将其写入cmd上

php -v

来验证。