Question

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

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): https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu

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

Errors:

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 xxx.xxx.xx.xx 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: 110.168.232.250, server: xxx.xxx.xx.xx , 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: “xxx.xxx.xx.xx”, referrer: “http://xxx.xxx.xx.xx/wp-admin/plugin-install.php?tab=search&s=woocommerce

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

Thank you so much!!!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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): try_files $uri $uri/ /index.php?q=$request_uri;
  3. Restart Nginx (SSH: service nginx restart)

Now everything is working perfectly.