November 12, 200916 yr I have installed a script and get this error. I cant find this error on line 1968. Please help me Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 184320 bytes) in /home/sites/mytyne.co.uk/public_html/inc/classes/BxDolGroups.php on line 1968
November 12, 200916 yr I have installed a script and get this error. I cant find this error on line 1968. Please help me Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 184320 bytes) in /home/sites/mytyne.co.uk/public_html/inc/classes/BxDolGroups.php on line 1968 You need to increase the memory limit in php.ini (or in your script if safe mode is off) In your script ini_set('memory_limit', '16M'); OR In php.ini (prefered) memory_limit = 16M
November 12, 200916 yr This most likely isn't a problem with one line of the script. That final line is just the "tipping point" (peak) of the problem. The memory allocation error occurs because the entire script cannot fit inside the default 8MB memory limit. The "quick fix" is to increase the memory limit for your script on the server. The real solution is to find out where the PHP script is requiring nearly 8MB memory and optimise the code better. It's obvious the script is 2000+ lines long, which is very long for an interpreted piece of code. Unless you're caching a lot of data in memory, I really don't see why it should overrun the limit however. You might also find useful links by Googling "PHP Allowed memory size exhausted".
November 12, 200916 yr This most likely isn't a problem with one line of the script. That final line is just the "tipping point" (peak) of the problem. The memory allocation error occurs because the entire script cannot fit inside the default 8MB memory limit. The "quick fix" is to increase the memory limit for your script on the server. The real solution is to find out where the PHP script is requiring nearly 8MB memory and optimise the code better. It's obvious the script is 2000+ lines long, which is very long for an interpreted piece of code. Unless you're caching a lot of data in memory, I really don't see why it should overrun the limit however. You might also find useful links by Googling "PHP Allowed memory size exhausted". 2000 lines isn't really too long for an included class. It's probably a file reading operation.. Reading data all at once instead of progressively. If you're not too confident at programming it's probabaly worth changing the file limit (as it may be generating a PDF for example)
Create an account or sign in to comment