我已经运行了nginx + php7的 Debian Stretch for wordpress网站。
这个问题不是关于wordpress ,而是关于php7.0-fpm (这只是说wordpress显示我当前的PHP问题)。 请不要告诉我“谷歌它”,我半天,尝试所有可能的解决scheme。 没有工作。
在一个WordPress的文章中,当我上传一个文件,我得到一个HTTP错误(注意,这不会发生在插件更新和类似的操作)。
有我尝试从中得到一个错误的文件types:
jpg png pdf mp3
还有我试过的文件types,我没有得到一个错误:
txt doc docx
这是php7.0-fpm.log当我重新启动php7.0-fpm并尝试上传三个不同的文件:
[11-Aug-2017 14:44:32] NOTICE: fpm is running, pid 661 [11-Aug-2017 14:44:32] NOTICE: ready to handle connections [11-Aug-2017 14:44:32] NOTICE: systemd monitor interval set to 10000ms [11-Aug-2017 14:50:35] WARNING: [pool www] child 749 exited on signal 6 (SIGABRT) after 363.688500 seconds from start [11-Aug-2017 14:50:35] NOTICE: [pool www] child 1234 started [11-Aug-2017 15:03:06] WARNING: [pool www] child 1546 exited on signal 6 (SIGABRT) after 183.839880 seconds from start [11-Aug-2017 15:03:06] NOTICE: [pool www] child 1573 started [11-Aug-2017 15:03:16] WARNING: [pool www] child 1573 exited on signal 6 (SIGABRT) after 9.961325 seconds from start [11-Aug-2017 15:03:16] NOTICE: [pool www] child 1574 started
这是nginx'error.log :
2017/08/11 14:50:35 [error] 776#776: *76 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 123.123.123.123, server: www.website.com, request: "POST /wp-admin/async-upload.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.website.com", referrer: "https://www.website.com/wp-admin/post.php?post=1055&action=edit" 2017/08/11 15:03:06 [error] 778#778: *284 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 123.123.123.123, server: www.website.com, request: "POST /wp-admin/async-upload.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.website.com", referrer: "https://www.website.com/wp-admin/post.php?post=1055&action=edit" 2017/08/11 15:03:16 [error] 778#778: *295 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 123.123.123.123, server: www.website.com, request: "POST /wp-admin/async-upload.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.website.com", referrer: "https://www.website.com/wp-admin/post.php?post=1055&action=edit"
这是我的nginx网站块有趣的部分(我猜):
location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_read_timeout 150; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
这是我的php7.0 www.conf的有趣部分(我推测):
pm = dynamic pm.max_children = 10 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3
问题是:
如果您需要更多关于我的设置的信息,请随时询问。
谢谢 !