changing upload_max_filesize in php.ini

April 21, 2015 1.5k views
WordPress Ubuntu

Hello! I had "413 Request Entity Too Large" problem.
So I've fixed it by adding

client_max_body_size 32m;

to nginx.conf.

Then I tried to upload my theme again and saw the message that I should change uploadmaxfilesize in php.ini.

I have nginx, so I've found /etc/php5/fpm/php.ini. And set parameters:

post_max_size = 16M
upload_max_filesize = 16M
memory_limit = 128M

Then I've rebooted nginx using

sudo service nginx restart

But the problem is still exists: when I'm trying to upload a theme a see a message about changing uploadmaxfilesize in php.ini

Please help! :)

3 Answers

When changing values in php5-fpm's php.ini you will need to restart the fpm service (not nginx) for the changes to take effect. So you will want to run:

service php5-fpm restart

Add following line to 'http{..}' block in nginx config:

http {
        client_max_body_size 100m;

Just done both variants. Still see the message about uploadmaxfilesize.
Anyway, thank you!

  • I did issue too, an the solution was very simple, after the updates in confgs files, save and did it this:

    sudo service php5-fpm restart

    don´t forget sudo, i did without sudo a lot of time and issue permanently, jeje

Have another answer? Share your knowledge.