系统是centos6.5执行
yum install php php-fpm php-bcmatch php-gd php-mbstring php-mcrypt php-mysql –y
yum install -y php-*
yum install -y curl curl-devel net-snmp net-snmp-devel perl-DBI
vim /etc/php.ini
date.timezone = Asia/Shanghai
post_max_size = 16M
max_execution_time =
300
max_input_time =
300
使用套接字方式
vim /etc/php-fpm.d/www.conf
;listen =
127.0
.
0.1
:
9000
listen = /dev/shm/php-cgi.sock
重启fpm
/etc/init.d/php-fpm restart
nginx配置文件修改套接字
location ~ \.php$ {
root /data/sns/home;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
nginx配置文件参考:
时间: 2024-10-05 22:13:01