Jump to content

Memory Limit Change - HELP PLEASE!


Recommended Posts

Hi All,

 

I am getting the following error.

 

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1024 bytes) in /var/www/xxx.xxx.xxx/xxxx/xxxx/xxxxxxxxxx.class.php on line 157

 

I have tried changing the memory limit through .htaccess using...

 

php_value memory_limit 12M

 

I have also tried changing it using "ini_set"... example below...

 

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

 

When I tried both of these, I get no error - the page just doesn't load at all (blank white page). As soon as I remove the memory limit setting - the page then loads, but with the memory limit error shown above.

 

I am unable to change the size in the php.ini file (this is not an option for me - don't have access).

 

What is happening? How can I fix this problem?

 

Any help is appreciated.

 

Thanks,

 

Matt.

 

Link to comment
https://forums.phpfreaks.com/topic/178673-memory-limit-change-help-please/
Share on other sites

The white screen is probably an error in your .htaccess file,

 

have you tried adding the

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

right above the line with the error..

 

However you may want to get a better host, as even if you get this to work, your host may just suspend your site for using too much resource. as I assume your on a shared host.

 

of course the other option (if possible) is to change your code, so it uses less memory

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.