How to fix Digital Ocean WordPress “The uploaded file exceeds the upload_max_filesize directive in php.ini”

how to fix file upload limit digitalocean wordpress
how to fix file upload limit digitalocean wordpress

I ran into this error when I was uploading a new theme to my blog. The issue is that the default memory limit for uploads is 2 MB when you use the 1 click wordpress install from digital ocean. It’s really easy to increase it to something reasonable like 8 MB.

First, log into your server shell


then edit the config file for PHP

sudo nano /etc/php5/apache2/php.ini

look for this line:

upload_max_filesize = 2M

wordpress php memory config
wordpress php memory config

and change it to this:

upload_max_filesize = 8M

then press ctrl+x to close, and press Y at the prompt to save, then press enter to confirm.

now, restart apache to load in the new changes.

sudo service apache2 restart

and that’s it! you’re done.

Now you’re free to upload your larger themes and other files that wordpress would normally reject on digital ocean.



Please enter your comment!
Please enter your name here