升级后 WordPress 管理仪表板挂起 PHP / MySQL

WordPress Admin Dashboard Hanging after Upgrading PHP / MySQL

所以,长话短说,最新版本的 Apache 导致我的特定设置出现一些错误,所以我快速即时升级到 PHP 7.1.6,切换到 mpm-event ,并开始使用 PHP-FPM。我想它可能也在那里的某个地方重新安装了 MySQL。

升级后,我的 WordPress 网站的前端看起来还算不错。管理仪表板有时没问题——但经常尝试 post 一个新页面,或做类似的事情,它会无限期地挂起。如果我重新启动 Apache,它会重新引起注意,但只要重新启动服务似乎就可以解决问题。

在此期间,我的网站前端也会开始挂起,直到我重新启动 Apache。

显然,我的配置某处有问题,但我很难确定它是什么。我网站的前端非常快,直到我在后端做了一些决定完全停止的事情。

我一直在检查我能想到的每一个错误日志,但是当发生这种情况时,我没有在 apache2 错误日志中看到任何发生的事情。据我所知,我启用了 PHP-fpm 错误日志记录,但我也没有看到任何显示。

此时我如何找出问题所在?

任何帮助将不胜感激。我已经花了至少 15 个小时试图解决这个问题,但进展为零。

谢谢大家。


php -v
PHP 7.1.6-1~ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun  9 2017 08:26:34) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.6-1~ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

apache2 -v
Server version: Apache/2.4.26 (Ubuntu)
Server built:   2017-06-30T08:42:23

/var/log/apache2/error.log -- 没有报告任何错误。

/var/log/fpm-php.www.log -- 空.

/var/log/mysql.err -- 空的。

/var/log/mysql.log -- 空。

/var/log/php7.1-fpm.log

[04-Jul-2017 02:08:40] NOTICE: fpm is running, pid 741
[04-Jul-2017 02:08:40] NOTICE: ready to handle connections
[04-Jul-2017 02:08:40] NOTICE: systemd monitor interval set to 10000ms

PHP 个模块 --

php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
json
libxml
mbstring
mcrypt
memcached
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

a2query -m:

a2query -m
dir (enabled by maintainer script)
headers (enabled by site administrator)
env (enabled by maintainer script)
authz_host (enabled by maintainer script)
reqtimeout (enabled by maintainer script)
include (enabled by site administrator)
rewrite (enabled by site administrator)
auth_basic (enabled by maintainer script)
alias (enabled by maintainer script)
authz_core (enabled by maintainer script)
asis (enabled by site administrator)
status (enabled by maintainer script)
cache (enabled by site administrator)
echo (enabled by site administrator)
autoindex (enabled by maintainer script)
authz_user (enabled by maintainer script)
fastcgi (enabled by maintainer script)
actions (enabled by site administrator)
filter (enabled by maintainer script)
mime (enabled by maintainer script)
expires (enabled by site administrator)
setenvif (enabled by maintainer script)
mpm_event (enabled by site administrator)
socache_shmcb (enabled by site administrator)
authn_file (enabled by maintainer script)
proxy (enabled by site administrator)
access_compat (enabled by maintainer script)
ssl (enabled by site administrator)
deflate (enabled by maintainer script)
authn_core (enabled by maintainer script)
suexec (enabled by site administrator)
negotiation (enabled by maintainer script)
proxy_fcgi (enabled by site administrator)
speling (enabled by site administrator)
http2 (enabled by maintainer script)
info (enabled by site administrator)
proxy_http2 (enabled by site administrator)

我不确定它是什么,但是 /var/log/apport.log 包含一些这样的错误:

ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: called for pid 12251, signal 11, core limit 0
ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: executable: /usr/sbin/apache2 (command line "/usr/sbin/apache2 -k start")
ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: apport: report /var/crash/_usr_sbin_apache2.0.crash already exists and unseen, doing nothing to avoid disk usage DoS

/var/log/kern.log:

Jul  4 02:08:39 localhost kernel: [    2.667815] ppdev: user-space parallel port driver
Jul  4 02:08:39 localhost kernel: [    2.691111] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:08:39 localhost kernel: [    2.716583] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:08:39 localhost kernel: [    2.717334] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:08:40 localhost kernel: [    5.345061] audit: type=1400 audit(1499148520.484:8): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/874/status" pid=874 comm="mysqld" requeste$
Jul  4 02:08:40 localhost kernel: [    5.345262] audit: type=1400 audit(1499148520.484:9): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=874 comm="mysqld"$
Jul  4 02:08:40 localhost kernel: [    5.345373] audit: type=1400 audit(1499148520.484:10): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/874/status" pid=874 comm="mysqld" request$
Jul  4 02:08:40 localhost kernel: [    5.391287] random: nonblocking pool is initialized
Jul  4 02:08:40 localhost kernel: [    5.577297] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:10:10 localhost kernel: [   95.097387] perf interrupt took too long (2626 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
Jul  4 02:26:07 localhost kernel: [ 1052.647086] audit: type=1400 audit(1499149567.761:11): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1445/status" pid=1445 comm="mysqld" reque$
Jul  4 02:26:07 localhost kernel: [ 1052.647352] audit: type=1400 audit(1499149567.761:12): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1445 comm="mysql$
Jul  4 02:26:07 localhost kernel: [ 1052.647513] audit: type=1400 audit(1499149567.761:13): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1445/status" pid=1445 comm="mysqld" reque$
Jul  4 02:26:23 localhost kernel: [ 1067.895962] audit: type=1400 audit(1499149583.008:14): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1446/status" pid=1446 comm="mysqld" reque$
Jul  4 02:26:23 localhost kernel: [ 1067.896241] audit: type=1400 audit(1499149583.012:15): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1446 comm="mysql$
Jul  4 02:26:23 localhost kernel: [ 1067.896340] audit: type=1400 audit(1499149583.012:16): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1446/status" pid=1446 comm="mysqld" reque$
Jul  4 02:31:19 localhost kernel: [ 1364.640301] perf interrupt took too long (5248 > 5000), lowering kernel.perf_event_max_sample_rate to 25000
Jul  4 02:37:26 localhost kernel: [ 1731.575398] audit: type=1400 audit(1499150246.686:17): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1540/status" pid=1540 comm="mysqld" reque$
Jul  4 02:37:26 localhost kernel: [ 1731.575508] audit: type=1400 audit(1499150246.686:18): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1540 comm="mysql$
Jul  4 02:37:26 localhost kernel: [ 1731.575596] audit: type=1400 audit(1499150246.686:19): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1540/status" pid=1540 comm="mysqld" reque$
Jul  4 02:42:49 localhost kernel: [ 2054.276362] perf interrupt took too long (10122 > 10000), lowering kernel.perf_event_max_sample_rate to 12500
Jul  4 04:00:02 localhost kernel: [ 6687.106794] perf interrupt took too long (20184 > 20000), lowering kernel.perf_event_max_sample_rate to 6250

稍后会编辑更多信息。

转到 "wp-config.php" 并将 "WP_DEBUG" 设置为 true,就像在以下示例中一样:

define( 'WP_DEBUG', true );

现在刷新前端和后端页面,以便能够看到 PHP 错误。

您还可以转到管理区域、设置、永久链接,然后再次单击 "save" 按钮。这将覆盖 .htaccess 文件。

您可以安装日志服务,在google 上搜索logly 或sentry。这些也可能有帮助。

我今天注意到我的服务器正在报告 Apache 的可用更新。我有点困惑,因为 'apache2 -v' 在这次更新之前和之后都显示 2.4.27。但无论如何它解决了我的问题。

可能与 CVE-2017-9789 相关。