Report this

What is the reason for this report?

How to increase Wordpress memory on Ubuntu?

Posted on July 12, 2015

Hey,

I tried to follow this guide: https://www.digitalocean.com/community/questions/what-do-i-do-to-edit-wp-config-php-for-increasing-memory-allocated-to-php

But . … I can’t find the wp-config.php file in ‘/var/www/’. Screenshot here: http://s30.postimg.org/ddfd6d0g1/wp_mem.jpg

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?



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!

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

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

upload_max_filesize=***100M***

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

post_max_size=***100M***

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

Restart PHP

Good luck! :)

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.