1

I'm testing Wordpress on Ubuntu 14.04 with Lemp and having some issues - the latest is I'm trying to import a 30mb file into Wordpress. Doing the import it says 128M limit - which I configured in the php.ini.

But I get a "Request Entity Too Large" error when I tried to upload.

Looking up that error I learned nginx has a default of 1mb for uploads and you need to add, to the nginx.conf (I also tried the .../sites-available/default) file the line:

client_max_body_size 128m   (for 128m limit)

When I do that I reload php - no problem.

When I try to restart nginx it says "fail" in red in my terminal window.

Can anyone help out?

  • When you try basic troubleshooting steps like sudo nginx -t or tail /var/log/nginx/error.log what error messages do you see? Please edit your question with the results. – Tom Brossman May 1 '15 at 9:10
  • hi Tom, Thanks - I hadn't check the logs…the error log is stating "invalid number of arguments for "client_max_body_size". I found hints Googling that information about the files and changes that need to be made for this to work - but it was only incident and that was with ubuntu 12.04 and nginx 1.1.19. I will update this more completely after trying out those solutions (I'm launching with Apache2 as it just seems simpler at this point to launch with Apache, and learn nginx after that's done:) - fyi, if anyone comes across this post - Mariadb was a huge - 300% - speed improvement over mysql. – Rob50 May 1 '15 at 21:06
  • Just tried those suggestions I found - editing the nginx.conf and the sites-enabled/default and set them to match the php.ini did the nginx reload and it failed again. nginx -t gave the "invalid number of arguments…" error in the nginx.conf - so I commented it out, reload again, fail again giving the same error for the default file. Removed it from that file, nginx reloads fine. I've tried it in multiple files and locations in those files - http, server, location - can't get it working. The nginx documention only tells you the syntax but doesn't give you the specific files to add it to. – Rob50 May 1 '15 at 21:46
2

You didn't write ; at the end of the line. :) I've done the same mistake - and got the same alert.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.