Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.