版权声明: https://blog.csdn.net/yangshuolll/article/details/84943048
主要是修改php-fpm的监听端口,然后修改nginx的配置,对应php-fpm的监听端口。
- 修改 /etc/php-fpm.d/www.conf 文件,将监听的 listen = 127.0.0.1:9000 改成 listen = 127.0.0.1:8999
- service php-fpm restart
- 修改 /etc/nginx/conf.d/default.conf 将其中 fastcgi_pass 127.0.0.1:9000 改成 fastcgi_pass 127.0.0.1:8999
location ~ .php$ {
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
- 重启nginx即可 (执行 service nginx restart )