1、安装php7
CentOs 7.X:
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
yum install php70w-pgsql
yum install php70w-devel
2、安装 httpd
yum install httpd
systemctl enable httpd.service
service httpd restart
3、安装 nginx
yum -y install nginx
chkconfig nginx on
service nginx restart
设置httpd监听端口 82
4、nginx 配置 php-fpm
server {
listen 80;
server_name ip地址;
client_max_body_size 200m;
location / {
proxy_pass http://127.0.0.1:82/;
proxy_set_header Host $host:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
proxy_redirect default;
}
}