Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Running a dedicated managed server with 2 GIGS of RAM. How much memory can I define in wp-config.php

Currently I have

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

I suspect a plugin that resizes images when they are being uploaded, that might cause the server to crash, but I am not sure yet.

How can I allocate more memory for this plugin to operate?

Many thanks Andy

share|improve this question
1  
Instead of 256M write 2048M ? Memory limits above 256 only work after WP ver 3.2 for the wp-config.php –  Wyck Dec 6 '12 at 19:55
add comment

2 Answers

Try one (or more) of the below methods to increase the memory allicated by PHP. First try increasing the limit to 64MB, and if that fails use 96M.


You can define the WP_MEMORY_LIMIT constant in wp-config.php:

Increase PHP Memory to 64MB

define('WP_MEMORY_LIMIT', '64M');

Increase PHP Memory to 96MB

define('WP_MEMORY_LIMIT', '96M');

You can also change the setting in your .htaccess file:

Increase PHP Memory to 64MB

php_value memory_limit 64M

Increase PHP Memory to 96MB

php_value memory_limit 96M

You can add a line to wp-config.php telling PHP to increase the memory limit:

Increase PHP Memory to 64MB

ini_set('memory_limit','64M');

Increase PHP Memory to 96MB

ini_set('memory_limit','96M');

This is not the most preferred method, and you should try the other methods first.

share|improve this answer
1  
I agree with everything except using ini_set(), do it in your php.ini or .htaccess, never in your code! –  theMojoWill Dec 7 '12 at 11:06
    
ok, I am not a server expert but i am just moving to a dedicated managed server with 12 GIGS of RAM.... What setting should I put in wordpress and where it's best to do that? :) –  Andy Jonathan Dec 7 '12 at 17:57
    
@theMojoWill I agree that the other methods are preferable - however, not everyone has access to .htaccess or php.ini. –  bungeshea Dec 7 '12 at 20:38
    
If you don't have access to .htaccess or php.ini then I doubt that the host will allow ini_set() –  theMojoWill Dec 10 '12 at 15:07
add comment

I don't have reputation to add comment that is why writing in answer. @theMojoWill you are correct if you don't have the permission to override the .htaccess and php.ini then you can not override any value using ini_set().

As per me best way to use ini_set() is to create new php.ini file in your project root and write there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.