Can't upload files to wordpress

Bug #1491995 reported by Nate Finch
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
wordpress (Juju Charms Collection)
Fix Released
Undecided
Matthew Ruffell

Bug Description

When you create a post or customize your site's appearance, you have the opportunity to upload files (i.e. pictures etc), which brings you to the "insert media" page.... uploads using this page apparently always fail with "http error". It appears to be an nginx configuration problem.

Note, I'm using just the default settings for wordpress (tuning=single etc) and mysql. This is easily reproducible with local provider (but is not specific to local provider).

Revision history for this message
Nate Finch (natefinch) wrote :

Appears to be an nginx configuration problem:

/var/log/nginx$ more error.log
2015/09/03 14:24:00 [error] 31196#0: *161 client intended to send too large body: 1326272 bytes, client: 10.0.3.1, server: _, request: "POST /wp-admin/async
-upload.php HTTP/1.1", host: "10.0.3.202", referrer: "http://10.0.3.202/wp-admin/customize.php?return=%2Fwp-admin%2F"
2015/09/03 14:41:49 [error] 31196#0: *314 client intended to send too large body: 1326367 bytes, client: 10.0.3.1, server: _, request: "POST /wp-admin/async
-upload.php HTTP/1.1", host: "10.0.3.202", referrer: "http://10.0.3.202/wp-admin/post-new.php"

Note, I'm uploading a file that is 1.3MB picture, and wordpress is defaulted to supporting 2MB... but evidently nginx's configuration is different.

Nate Finch (natefinch)
description: updated
Revision history for this message
Johan Ehnberg (johan-ehnberg) wrote :

I am seeing this as well. The cut-off seems to be around 1M. It happens despite the following settings:
/etc/nginx/nginx.conf:
client_max_body_size 500M;

/etc/php5/fpm/php.ini:
upload_max_filesize = 16M
post_max_size = 8M

Revision history for this message
Richard Harding (rharding) wrote :

I've changed the nginx conf, which was set to 512k out of the default deploy, restarted nginx, and been able to upload a 1.8mb file.

    sudo vim /etc/nginx/nginx.conf

# change client_max_body_size 2M;

    sudo service nginx restart

and the upload worked.

Revision history for this message
Matthew Ruffell (mruffell) wrote :

This bug has been fixed in the major maintenance performed on the wordpress charm, now known as cs:wordpress-0.

Uploading files works better now. I have changed upload_max_filesize to 16M.

For more information, see Bug 1827164.

Changed in wordpress (Juju Charms Collection):
status: New → Fix Released
assignee: nobody → Matthew Ruffell (mruffell)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.