通常狀況網頁報502 很大多是配置文件出錯了,最大多是fastcgi_pass unix:這個參數錯誤。
因此直接去找php fpm下面的www.conf裏面的listen
/etc/php/5.6/fpm/pool.d/www.conf
或者是/etc/php/7.0/fpm/pool.d/www.conf 具體在哪裏看你怎麼裝php
若是Listen是端口就寫127.0.0.1:9000;html
若是Listen是路徑,nginx的配置文件也要寫路徑,unix:/run/php/php5.6-fpm.sock;或者/run/php/php7.0-fpm.sock; 反正裏面是什麼就填什麼。nginx
netstat -ant | grep 9000服務器
若是出現404 找不到頁面的問題是由於服務器不支持重寫。不支持tp框架的pathinfo這套東西。php7
# --start--- TP5加上這一塊 支持pathinfo location /{ index index.html index.htm index.php; if (-e $request_filename) { break; } if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } } location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+)$; try_files $fastcgi_script_name =404; set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; } # --end--- TP5加上這一塊 支持pathinfo