在FreeBSD下的nginx服务器,需要借助FastCGI来解析PHP。更改php.ini配置文件,则需要重新启动FastCGI。操作如下 :
检查 FastCGI 是否启动
# sockstat -5 | grep 9000 www php-cgi 1125 0 tcp4 127.0.0.1:9000 *:*
启动 PHP FastCGI:
# /usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www -g www -f /usr/local/bin/php-cgi
-a 127.0.0.1 : PHP FastCGI 绑定IP地址
-p 9000: PHP FastCGI 指定端口
-u www : PHP FastCGI 用户名
-g www : PHP FastCGI 用户组
-f /usr/local/bin/php-cgi : 指向 PHP5 fastcgi
关闭FastCGI:
#pkill -9 php-cgi