changing upload_max_filesize in php.ini

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 upload_max_filesize 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 upload_max_filesize in php.ini

Please help! :)


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

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.


You can create a php info file in order to check the current values and check which is the php.ini file in use. Create the following file in your public_hmtl folder - phpinfo.php and put the following code inside it:


You can also use the following command in order to find the location of the php.ini file:

php -i | grep php.ini

The output should be:

Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini

Then check for the current value of uploadmaxfilesize you can also check which is the configuration file - php.ini that is currently used and apply the changes there (if the site using the global php.ini file and you change the values for these settings this will make the changes globally for all sites). Ideally you would like to have the following values:

upload_max_filesize = 64M post_max_filesize = 64M

You also need to restart your web server (Nginx and PHP-FPM) in order the changes to take effect.

Hope that this helps! Regards, Alex

Work for me…Thank you!

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

Add following line to ‘http{…}’ block in nginx config:

http {
        client_max_body_size 100m;

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