我试图在运行Nginx的Ubuntu 16服务器上安装第二个WP站点(dancortes.press)。 第一个网站(microurb.club)已经成功安装。 我没有这个问题。
我已经根据第二个网站(dancortes.press)的服务器结果成功安装了WordPress,但是我仍然只能得到Nginx的主页。 我认为这可能是一个事实,即集团所有者是用户,所以我改变了networking文件组的所有者到万维网数据:
microurb@vps148370:/var/www/dancortes.press/public_html$ ls -l total 192 -rw-r--r-- 1 microurb www-data 0 Oct 5 15:36 index.html -rw-rw-r-- 1 microurb www-data 418 Oct 8 17:07 index.php -rw-rw-r-- 1 microurb www-data 19935 Oct 8 17:07 license.txt -rw-rw-r-- 1 microurb www-data 7413 Oct 8 17:07 readme.html -rw-rw-r-- 1 microurb www-data 5447 Oct 8 17:07 wp-activate.php drwxrwxr-x 9 microurb www-data 4096 Oct 8 17:07 wp-admin -rw-rw-r-- 1 microurb www-data 364 Oct 8 17:07 wp-blog-header.php -rw-rw-r-- 1 microurb www-data 1627 Oct 8 17:07 wp-comments-post.php -rw-rw-r-- 1 microurb www-data 2599 Oct 8 17:17 wp-config.php -rw-rw-r-- 1 microurb www-data 2853 Oct 8 17:07 wp-config-sample.php drwxrwxr-x 5 microurb www-data 4096 Oct 8 17:19 wp-content -rw-rw-r-- 1 microurb www-data 3286 Oct 8 17:07 wp-cron.php drwxrwxr-x 18 microurb www-data 12288 Oct 8 17:07 wp-includes -rw-rw-r-- 1 microurb www-data 2422 Oct 8 17:07 wp-links-opml.php -rw-rw-r-- 1 microurb www-data 3301 Oct 8 17:07 wp-load.php -rw-rw-r-- 1 microurb www-data 34327 Oct 8 17:07 wp-login.php -rw-rw-r-- 1 microurb www-data 8048 Oct 8 17:07 wp-mail.php -rw-rw-r-- 1 microurb www-data 16200 Oct 8 17:07 wp-settings.php -rw-rw-r-- 1 microurb www-data 29924 Oct 8 17:07 wp-signup.php -rw-rw-r-- 1 microurb www-data 4513 Oct 8 17:07 wp-trackback.php -rw-rw-r-- 1 microurb www-data 3065 Oct 8 17:07 xmlrpc.php
我以为这个问题可能是index.html文件,所以我删除它,并重新启动nginx,仍然只有Nginx的主页。 我重新启动了Nginx几次。
我检查了访问和错误日志,我得到的是关于第一个网站上的代码的错误。
我检查了nginx访问日志:
73.197.81.232 - - [08/Oct/2017:19:10:55 -0400] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" 73.197.81.232 - - [08/Oct/2017:19:10:56 -0400] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
错误日志有关于我的第一个网站上的代码错误:
PHP message: PHP Notice: Undefined index: success in /var/www/microurb.com/public_html/index.php on line 295" while reading upstream, client: 71.168.149.103, server: microurb.club, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "microurb.club" 2017/10/08 19:10:01 [alert] 22798#22798: *25 open socket #11 left in connection 3 2017/10/08 19:10:01 [alert] 22798#22798: aborting 2017/10/08 19:10:52 [alert] 23108#23108: *3 open socket #3 left in connection 3 2017/10/08 19:10:52 [alert] 23108#23108: aborting
我真的不知道接下来要找什么。 为什么我看不到WP网站?
这是我的/etc/nginx/sites-available/dancortes.press服务器文件:
server { listen 80; listen [::]:80; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # include snippets/snakeoil.conf; root /var/www/dancortes.press/public_html; # Add index.php to the list if you are using PHP index index.php; server_name dancortes.press; include global/restrictions.conf; include global/wordpress.conf; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } }
下面我添加我的DNSconfiguration的屏幕截图:
错误消息说,index.php中的PHP在295行格式不正确。WordPress的index.php是17行。 这可能是包含的文件在该文件中被计为行。
检查PHP解释器正在运行的文件。 重新安装Wordpress。 检查你调用PHP的Nginxs设置是否正确。 有些主题与PHP7不兼容。