Windows下运行php-cgi报错如下:


D:\php>php-cgi.exe -b 127.0.0.1:9000 -c php.ini

PHP Warning:  PHP Startup:  in Unknown on line 0

<br />

<b>Warning</b>:  PHP Startup:  in <b>Unknown</b> on line <b>0</b><br />

PHP Warning:  PHP Startup:  in Unknown on line 0

<br />

<b>Warning</b>:  PHP Startup:  in <b>Unknown</b> on line <b>0</b><br />

PHP Warning:  PHP Startup:  in Unknown on line 0

<br />


解决方法:

这是PHP配置的问题,找开php.ini文件,找到“extension_dir”

;extension_dir = "./"  改为:
extension_dir = "D:/php/ext"

注:更改为绝对路径即可;