Increasing memory limit via php.ini

I’ve been having some memory issues and it’s been suggested that I increase my memory limit via php.ini of course I have no idea how to do that. (My theme shows that the current limit is set to 40)

I know to access my site via ftp but can’t seem to find the file. Is there a way I can create the file on my own? What’s the easiest way.

The only file I found with any mention of memory was my wp-settings.php file but I wasn’t sure if that was right so I didn’t touch it.

I’ve read the instructions Dreamhost php.ini wiki but has just confused me even more.

Any suggestions?


The file won’t exists on it’s own.

Via FTP, look in the folder ABOVE your webfolder. There you should see these:


and some files.

Make a new folder called .php (yes with the . in front) and in THAT folder, make another folder for your PHP version (either 5.3 or 5.4).

In that .php/5.4/ folder, you put a file called phprc (no periods) and that’s where you increase your memory :slight_smile:

okay the first couple of steps sound pretty straight forward but how do I create the phprc file? via notepad? and just name in phprc (no periods)


You can do it in notepad. I suggest grabbing (it’s free) for Windows, though. It’s way more sensible. And yes, it’s JUST phprc. No file extensions :slight_smile:

Just noticed I was set to PHP5.5 does this matter? Should I switch to the 5.4 default?

Also the line I should be putting in the phprc file is as follows?

define(‘WP_MEMORY_LIMIT’, ‘128M’);


define(‘WP_MEMORY_LIMIT’, ‘256M’);

okay I switched to PHP5.4 since that’s the default and I followed your instructions.

Here’s a screen cap of the directories.

In the phprc “txt” file I put only the following line.

define(‘WP_MEMORY_LIMIT’, ‘128M’);

Is everything correct? How do I confirm that the memory limit has been increased?


Create a web page that runs “phpinfo()”. One such as:

PHP Info <?php echo phpinfo();?>

would do. Just call it something like “info.php” and then call it up in your web browser. The results will be quite lengthy, but the item that you are looking for is called “upload_max_filesize”.

Once you have done this, please remove or move the file out of your website directory. The phpinfo gives out a great deal of information about your website and should not just be left “lying around” to be accessed by a web page unless you need it.

weird it says it’s still at 64M which is the default.

Did I put the phprc file in the right directory?

screen cap here

The line I put in the phprc file is

define(‘WP_MEMORY_LIMIT’, ‘128M’);

This page in the dreamhost wiki, shows

memory_limit = 128M

in the only example on the page. I’d try that. What you’ve included looks more like something that might be in wpconfig.

Note on the same wiki page, the killall command for your version of php, so that the changes can take effect immediately rather than waiting.

…then try phpinfo again.