How to increase Wordpress memory on Ubuntu?


I tried to follow this guide:

But . … I can’t find the wp-config.php file in ‘/var/www/’. Screenshot here:

I had a search and found ‘wp-config.php’ in ‘/var/www/html’, but I’m not sure if that is the right one. Either way, adding ‘define( ‘WPMAXMEMORY_LIMIT’, ‘256M’ );’ to that file didn’t seem to make a difference.

Any ideas?


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.

This comment has been deleted

Depends on where you have installed wordpress ofcourse. If wordpress is installed in /var/www/html your wp-config file will be there. If you like to increase the memory, you will have to edit the wp-config.php with define( 'WP_MEMORY_LIMIT', '96M' ); for example. You need to make sure you got enough memory for this and you got the proper php.ini configuration. If not, you need to allow php in the ini file to use enough memory. You can find out more about that online.

When in the administration area, the memory can be increased or decreased from the WP_MEMORY_LIMIT by defining WP_MAX_MEMORY_LIMIT. You can therefor use

define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Please note, this has to be put before wp-settings.php inclusion.

You can do from within your php.ini file.

sudo nano /**YOUR**/**PATH**/**TO**/php.ini

Press Ctrl+W and search for upload_max_filesize ,set it to your desired size


Press Ctrl+W and search for post_max_size ,set it to your desired size, which needs to be at least the same size or larger than upload_max_filesize


Save / Exit CTRL+X, Then Y, Then Enter

Restart PHP

Good luck! :)