昨天登陆VPS,看到ubuntu有几个安全更新,就upgrade了一把,结果fast-cgi的进程就无法启动了,具体症状为:
运行“/usr/bin/spawn-fcgi 参数省略……”,出现错误:
spawn-fcgi: child exited with: 254
检查“php -v”,没有发现问题。
检查“php-cgi -v”,报错:
# php-cgi -v
PHP Warning: [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.10-2ubuntu6.3. Rebuild it for your PHP version (5.2.10-2ubuntu6.4) or download precompiled binaries.
in Unknown on line 0
PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0
原来是升级之后,eAccelerator版本不符合了,需要重新编译安装。
于是下载eAccelerator最新版,重新安装之:
#tar -zxvf ./eaccelerator-0.9.5.tar.bz2
#cd eaccelerator-0.9.5
#export PHP_PREFIX="/usr/local" (把PHP安装目录导入到环境变量,FreeBSD默认是/usr/local)
#$PHP_PREFIX/bin/phpize
#./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
#make
#make install
以前已有的php设置无需改动。(如果你是第一次安装eaccelerator,请参考其安装说明进行设置)
重新启动spawn-fcgi,恢复正常了。

