2

i have joomla, virtuemart, when enable debug mode get error. How to fix it ? i have vps server centos

Fatal error: Allowed memory size of 272629760 bytes exhausted (tried to allocate 284095 bytes) in /plugins/system/debug/debug.php on line 1213
Fatal error: Allowed memory size of 272629760 bytes exhausted (tried to allocate 232974 bytes) in /plugins/system/debug/debug.php on line 1061
Fatal error: Allowed memory size of 272629760 bytes exhausted (tried to allocate 233968 bytes) in /plugins/system/debug/debug.php on line 1064
Fatal error: Allowed memory size of 272629760 bytes exhausted (tried to allocate 285383 bytes) in /plugins/system/debug/debug.php on line 1216
Alexey
  • 17
  • 8

2 Answers2

2

256 MB is more than enough for almost all Joomla websites. If you need more then most likely the problem will not be fixed with the allocation of more memory.

You have a memory leak somewhere (most likely caused by a recursive function that never ends) - the reason why the increase to 4 GB (4294967296 bytes) seemed to work is that the server timed out. Check this post on how to find that memory leak on your Joomla website (if you're not very technical, then start disable 3rd party modules/plugins until you find the culprit).

itoctopus
  • 3,872
  • 4
  • 28
  • 42
0

Just add this below line to before line or function of you getting error in your file

ini_set('memory_limit', '-1');

If you want server unlimited me usage for all function and all app, you add this line to php.ini file

memory_limit = -1

Or define max memory usage

memory_limit = 1024M

Refer this question Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

Update: Try modify your index.php like that:

define('JOOMLA_MINIMUM_PHP', '5.3.10');

ini_set('memory_limit', '-1');

if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<'))
{
    die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!');
}

Goodluck and have fun!

Community
  • 1
  • 1
ThanhPV
  • 433
  • 5
  • 13
  • all solutions not help me Fatal error: Allowed memory size of 272629760 bytes exhausted (tried to allocate 233968 bytes) in /var/www/.ru/public_html/plugins/system/debug/debug.php on line 1064 ####### Fatal error: Allowed memory size of 272629760 bytes exhausted (tried to allocate 285383 bytes) in /var/www/domains/enimpuls.ru/public_html/plugins/system/debug/debug.php on line 1216 – Alexey Jul 08 '16 at 02:27
  • Not a good solution as the culprit is still there. What you are doing is staying with the error. – Amit Ray Jul 08 '16 at 02:40
  • Refer for update answer: [https://www.robertwent.com/blog/joomla/19-joomla-increase-php-local-memory-limit-without-changing-server-settings](https://www.robertwent.com/blog/joomla/19-joomla-increase-php-local-memory-limit-without-changing-server-settings) – ThanhPV Jul 08 '16 at 02:52
  • If server down, you must check your code, it use so many memory :) – ThanhPV Jul 08 '16 at 05:40