The uploaded file exceeds the upload_max_filesize directive in php.ini.

Trying to add a theme that I downloaded for Wordpress but when I try to upload it, it states the following:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

How do I fix this?

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.

You might have different versions of php.ini files in your installation. To check which one you should be altering its upload_max_filesize line, use:

php -i | grep "Loaded Configuration File"

Then do a

sudo service nginx restart

I bumped into exactly the same problem few days ago. The solution I found was adding the following lines to php.ini in the root directory of the Wordpress install.

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

However, the system didn’t seem to honor the settings. Instead, editing /etc/php5/fpm/php.ini solved this problem for me.

By increasing upload_max_filesize in your php.ini.