I've Debian Stretch running nginx + php7 for a wordpress website.
This question is not about wordpress, but about php7.0-fpm (it's just that wordpress is showing my current php problem). And please, don't tell me to "google it", I dit for half a day, tried all the possible solutions. None worked.
In a Wordpress post, when I upload a file I get an HTTP error (note that this doesn't happend on plugin updates and similar operations).
There are the file types I tried from which I get an error :
jpg png pdf mp3
And there are the file types I tried from which I don't get an error :
txt doc docx
This is the php7.0-fpm.log when I restart php7.0-fpm and try to upload three different files :
[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
This is 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"
This is the interesting part (I presume) of my nginx website block :
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;
}
This is the interesting part (I presume) of my php7.0 www.conf :
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
Questions are :
- Why does childs exits ?
- If this is due to a misconfiguration, how can I resolve the problem ?
If you need more informations on my setup, feel free to ask for.
Thanks !