当前位置:Gxlcms > PHP教程 > nginx不能解析php

nginx不能解析php

时间:2021-07-01 10:21:17 帮助过:29人阅读

首先先安装php-fpm

  1. yum install php-fpm
  2. service php-fpm start #启动 php-fpm

然后修改nginx配置文件nginx.conf 识别php

vi /usr/local/nginx/conf/nginx.conf 加一段代码

  1. location ~ \.php$ {
  2. #fastcgi_split_path_info ^(.+\.php)(/.+)$;
  3. root /usr/share/nginx/html;
  4. fastcgi_pass 127.0.0.1:9000;
  5. fastcgi_index index.php;
  6. fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
  7. include fastcgi_params;
  8. #$document_root
  9. }

最后重启nginx和php-fpm

  1. service nginx restart
  2. service php-fpm restart

推荐教程:PHP视频教程

以上就是nginx不能解析php的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行