System OS:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS
I have installed a LEMP stack:
nginx/1.10.0 (Ubuntu)
MySQL 5.7.18-0ubuntu0.16.04.1
PHP 7.0.15-0ubuntu0.16.04.4
The system is hanging and displaying a 'connection reset' error message in the browser when I try to upload a theme or a plugin.
I have managed to install some plugins from the Wordpress repository, but I can not install a 15MB plugin I am uploading via a zip from my remote machine via the browser.
I have increased the memory limit to 512mb by editing /etc/php/7.0/fpm/php.ini
and the php.ini script is now reporting this is taking effect:
memory_limit 512M 512M
I have also increased the max memory limit in wp-config.php
by inserting this as the first line in the file:
define('WP_MEMORY_LIMIT', '512M');
I have also created the following settings in the php config file at /etc/php/7.0/fpm/php.ini
:
max_execution_time = 240
max_input_time = 240
upload_max_filesize = 100M
Yet plugins or themes are still not uploading.
I have tried both Firefox and Chrome.
In Chrome, you get a % complete while the zip is being uploaded. The upload gets to 44% and then crashes, and I get the 'Connection Reset' error in the browser.
I have changed ownership of the plugin directory and wp-content directory to www-data:www-data
.
I don't know what else to try, any ideas?
I have the same problem and solve it by editing my htaccess, and it looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# WP Maximum Execution Time Exceeded
<IfModule mod_php7.c>
php_value max_execution_time 300
php_value upload_max_filesize 50M
php_value post_max_size 80M
php_value max_input_time 300
</IfModule>
php_value max_execution_time 3000
</IfModule>
Then only add this part at the end of the htaccess:
# WP Maximum Execution Time Exceeded
<IfModule mod_php7.c>
php_value max_execution_time 300
php_value upload_max_filesize 50M
php_value post_max_size 80M
php_value max_input_time 300
</IfModule>
php_value max_execution_time 3000
</IfModule>
Of course you can also change the numbers!
That helped me! Hope will help you also!
Atanas
As Atanas suggested in the answer posted for Apache, the problem was maximum file upload size in the web-server config.
To resolve the error in NGINX, I placed the following in the server block:
client_max_body_size 100M;
(adjust to the size of your desired max upload size as required).
For example here is the full NGINX config I am running, with the above variable set:
{
listen 80 default_server;
listen [::]:80 default_server;
client_max_body_size 100M;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name xxx.xxx.xx.xxx;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}