Lemp + WordPress: Media Upload + Plugin Install fails, but theme install works

January 13, 2016 673 views
LEMP WordPress Ubuntu

Hi there,

I just ran into a very weird issue. I finally got my website migrated to Nginx on a DigitalOcean droplet (thank god), but now I cannot seem to find a solution for the issues below. As a reference: I followed this tutorial (adjusted the paths/group for Nginx accordingly):

I am on a Ubuntu 14.04.3 x64 droplet, running Nginx with PHP FPM.


When I try to upload any media files: The uploaded file could not be moved to wp-content/uploads.

When I try to install a new plugin: On the page, where it usually says something like "Installing Plugin: XYZ" ... it is just a blank page (but sidebar and navigation in the dashboard appear. Simply no content on the page, even with WP Debug enabled)

When I try to install a new theme: Works flawlessly.

When I try to update a theme: Works sometimes (weird). E.g. NavXT Breadcrumb Plugin updated without issues, but the WooCommerce Update failed.

Here are the permissions (currently quite open with 775, I just used it for testing purposes for now):
-r--r--r-- 1 wp-user wp-user 28 Jan 10 09:49 index.php
drwxr-xr-x 2 wp-user wp-user 4096 Jan 10 09:48 languages
drwxrwxr-x 4 wp-user wp-user 4096 Jan 12 23:36 plugins
drwxr-xr-x 9 wp-user wp-user 4096 Jan 12 23:30 themes
drwxr-xr-x 3 wp-user wp-user 4096 Jan 12 23:38 upgrade
drwxr-xr-x 11 wp-user wp-user 7430144 Jan 12 07:59 uploads

In Nginx error log, this came up, when I tried to install the WooCommerce plugin (for the servers safety I changed my ip to in the log below):

2016/01/12 23:41:29 [error] 956#0: *72 readv() failed (104: Connection reset by peer) while reading upstream, client:, server: , request: "GET /wp-admin/update.php?action=install-plugin&plugin=woocommerce&_wpnonce=efd1319a5a HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "", referrer: ""

I really loose my mind with this. Did anyone have a similar situation or is able to help?

Thank you so much!!!

1 comment
  • Additional information: It does not make difference if I try to install a new plugin through the WordPress Repository or upload a zip file.

1 Answer

Okay, after days of testing and 2 hours after I finally decided to ask the question here, I figured it out...

The Solution: (aka things I have done until it was working):

  1. I installed CURL (SSH: apt-get install curl libcurl3 libcurl3-dev php5-curl)
  2. I added my site's config file (in /etc/nginx/sites-available): In "location / {": Add this line (or if already existing change the line to this): tryfiles $uri $uri/ /index.php?q=$requesturi;
  3. Restart Nginx (SSH: service nginx restart)

Now everything is working perfectly.

Have another answer? Share your knowledge.