tp5 centos7 nginx 502空白页面

部署了tp5上去后,配置了vhost.conf,访问时502,php index.php无输出,使用 echi 1;die;,发现在start.php的run就没了,也不太好追,应该是NGINX没配好,但是又不知道哪里写错了,求大神帮忙看看

vim /usr/local/nginx/conf/vhost/lcd.com.conf

server {

   listen       80;
    server_name  lcd.com;
    root   "/home/wwwroot/web/PHP/op.cheduo.com/public";
    location / {
      if (!-e $request_filename) {
        rewrite  ^/(.*)$  /index.php/?s=$1  last;
        break;
      }
        index  index.html index.htm index.php;
        #autoindex  on;
    }
    location /apis/ {
      rewrite  ^/apis/(.*)$ /$1 break;
      proxy_pass   http://192.168.1.130;
    }
    include enable-php-pathinfo.conf;
    location ~ \.php$
    {
        #root html;
        #修改了以下两句就好了
        #1
        fastcgi_pass unix:/tmp/php-cgi.sock;
        fastcgi_index index.php;
        #2
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    # access_log  /home/wwwroot/web/PHP/op.cheduo.com/log/access_log.log;
     error_log  /home/wwwroot/web/PHP/op.cheduo.com/log/error_log.log;
    }

vim /usr/local/nginx/conf/fastcgi.conf


fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REQUEST_SCHEME     $scheme;
fastcgi_param  HTTPS              $https if_not_empty;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/wwwroot/web/PHP/";
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";

以上为修改的配置,求助大神们看看有没有哪里写错

阅读 2.9k
1 个回答

echi 1;die; //应该是echo 吧

index index.html index.htm index.php;

这行放server_name下行去

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题