Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法连接,can’;t建立与服务器的连接_Php_Nginx_Http Status Code 404_Ubuntu Server - Fatal编程技术网

Php 无法连接,can’;t建立与服务器的连接

Php 无法连接,can’;t建立与服务器的连接,php,nginx,http-status-code-404,ubuntu-server,Php,Nginx,Http Status Code 404,Ubuntu Server,我知道这个问题已经被问了很多次,不幸的是,在我的场景中,我似乎没有找到问题所在 在使用具有这些配置的nginx设置站点之后' server { listen 80; listen [::]:80; server_name xxxxxx.xxxxxxx.co.zw; root /var/www/xxxxxx; index index.php; access_log /var/log/nginx/example.com.access.log; error_log /var/log/ngin

我知道这个问题已经被问了很多次,不幸的是,在我的场景中,我似乎没有找到问题所在

在使用具有这些配置的nginx设置站点之后'

server {
listen 80;
listen [::]:80;
server_name  xxxxxx.xxxxxxx.co.zw;
root   /var/www/xxxxxx;
index  index.php;

access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;

client_max_body_size 100M;

autoindex off;

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php$ {
     include snippets/fastcgi-php.conf;
     fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;
}
}'
公共(lavarel站点)中的.htacess文件具有以下配置'

  <IfModule mod_rewrite.c>
  <IfModule mod_negotiation.c>
       Options -MultiViews
  </IfModule>

  RewriteEngine On

  # Redirect Trailing Slashes...
  RewriteRule ^(.*)/$ /$1 [L,R=301]

  # Handle Front Controller...
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
  </IfModule>'
错误日志为空,这是访问日志'

127.0.0.1 - - [13/Dec/2019:08:00:46 +0000] "GET / HTTP/1.1" 200              396 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0"
127.0.0.1 - - [13/Dec/2019:08:00:47 +0000] "GET /favicon.ico HTTP/1.1" 404 134 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0"
127.0.0.1 - - [13/Dec/2019:08:16:36 +0000] "GET /phpinfo.php  HTTP/1.1" 200       21 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101     Firefox/71.0"
127.0.0.1 - - [13/Dec/2019:08:17:43 +0000] "GET / HTTP/1.1" 304 0 "-"     "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0"'

请提供帮助。

请检查nginx的access.log和error.log以调试此问题。

是否可以检查ngix服务器错误日志?如果找到,请在此处发布。
127.0.0.1 - - [13/Dec/2019:08:00:46 +0000] "GET / HTTP/1.1" 200              396 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0"
127.0.0.1 - - [13/Dec/2019:08:00:47 +0000] "GET /favicon.ico HTTP/1.1" 404 134 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0"
127.0.0.1 - - [13/Dec/2019:08:16:36 +0000] "GET /phpinfo.php  HTTP/1.1" 200       21 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101     Firefox/71.0"
127.0.0.1 - - [13/Dec/2019:08:17:43 +0000] "GET / HTTP/1.1" 304 0 "-"     "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0"'