开发者社区> 问答> 正文

centos6.3 nginx wordpress 安装问题- centos报错

通过http://192.168.1.x/wordpress/readme.html访问,可以看到静态的html页面内容。

但是输入http://192.168.1.x/wordpress/wp-admin/install.php提示

502 Bad Gateway

nginx配置如下:

server {
listen       80;
server_name  localhost;
root         /usr/local/web/;
try_files $uri $uri/ /index.php;
location ~ \.php$ {
include        fastcgi_params;
fastcgi_pass   localhost:53217;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
}
}

展开
收起
montos 2020-06-02 18:41:29 591 0
1 条回答
写回答
取消 提交回答

  • server {
    	root  /usr/local/web/;
    	index index.html index.htm index.php;
    	location / {
    		try_files $uri $uri/ /index.php?$args;
    	}
    	location ~ \.php$ {
    		fastcgi_pass   127.0.0.1:53217;
    		fastcgi_index  index.php;
    		include fastcgi.conf;
    	}
    }

    确定你的PHP-FPM端口是53217,网站根目录是/usr/local/web/。


    ######回复 @cyzshenzhen : 一般来说,PHP-FPM默认的端口是9000。######回复 @cyzshenzhen : sudo netstat -antp|grep php-fpm######怎么查看PHP-FPM端口?######

    php-fpm的默认端口端口应该是9000; 默认配置文件应该是 /etc/php-fpm.d/www.conf

    ######的确是端口问题。 3Q
    2020-06-02 18:41:38
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载