What do i do to edit < wp-config.php > for increasing memory allocated to PHP

March 4, 2015 4.4k views
MySQL PHP WordPress

Unfortunately, I am still a beginner.
So I still don't know lots of things. and still wait lots of help.

I use the VPS, Ubuntu WordPress on 14.04 (Memory 512MB, Singapore)

  1. Does My Host allow for increasing the PHP memory limit, I want 128MB?
  2. If yes, What do I do to change?
  3. If I change like 'memorylimit = 128M' in "php.ini", I don't need to edit like 'define('WPMEMORY_LIMIT', '128M') ' in "wp-config.php"

Thanks in advance to everyone who help me with comment : )

3 Answers
  1. It is your VPS, so you can configure it how you like..one of the advantages of having a VPS rather than shared hosting.

  2. you will edit your php.ini which is located at /etc/php5/apache2/php.ini

  3. edit these lines to 200M or whatever you want:

memory_limit = 200M
upload_max_filesize = 200M
post_max_size = 200M

4.restart apache and see if that works

5.start a notebook or tomboy notes and add that for future reference

  • I think it doesn't work with editing php.ini.

    I have to edit "wp-config.php"
    So how can I edit this file?

    By the way, Memory limit is 512M in "php.ini"

You could try:

sudo nano /var/www/wp-config.php
Have another answer? Share your knowledge.