(0)安装php环境
# yum install nginx php-fpm php-mysql mysql-server php-mbstring php-gd php-pear php-mcrypt php-mhash php-eaccelerator php-suhosin php-tidy php-curl
(1) connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory)
当时弱弱的发现路径下没有这个文件以为是自己安装php出了问题,后来了解到这是动态生成哒.
$vim /etc/php-fpm.d/www.conf
找到那行 listen = 127.0.0.1:9000
在下面添上一行 listen = /var/run/php5-fpm.sock
把默认的backlog的值改成4096
; Set listen(2) backlog. A value of '-1' means unlimited.
; Default Value: 4096
;listen.backlog = 4096
接下来把user group 都改成nginx,因为默认是apache
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
(2)重启php-fpm
sudo /etc/init.d/php5-fpm restart
service php-fpm start
service php-fpm stop
(3)nginx报错 Primary script unknow
vim /etc/nginx/nginx_conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;