Jump to content

[solved] Fatal Error: Allowed memory size ..... exhausted


Recommended Posts

Hi, i try make an order in my shop and when i reach the payment a see this error:

 

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/xsurvive/public_html/drinks/tools/smarty/sysplugins/smarty_internal_compile_foreach.php on line 122

 

line 122 of this file is:

 

120: if ($has_name) {

121: if ($usesSmartyTotal) {

122: $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['total'] = \$_smarty_tpl->tpl_vars[$item]->total;\n";

 

i change line in php.ini

 

from:

max_execution_time = 30 ; Maximum execution time of each script, in seconds

max_input_time = 60 ; Maximum amount of time each script may spend parsing request data

memory_limit = 32M ; Maximum amount of memory a script may consume (32MB)

 

to:

max_execution_time = 300 ; Maximum execution time of each script, in seconds

max_input_time = 600 ; Maximum amount of time each script may spend parsing request data

memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)

 

but error still appear

 

I also add line in .htaccess

 

php_value memory_limit 128M

 

But after that i have Server error 500

 

Please help.

Edited by Beherit (see edit history)
  • Like 1
Link to comment
Share on other sites

Ok. After 3 days i solve a problem just minutes after i made this post. I,m with cpanel and i needed to make some different modifications in .htaccess file. But from beginning

 

1. You must change the memory limit in php.ini

it's too high but any way i make mine:

 

memory_limit = 512M

 

2. To be sure that memory limit is active already make simple file and put it in mine directory. Something like that.

 

<?php

phpinfo();

?>

After that start it like that:

http://domain.tld/name-of-the-file.php

 

Where domain.tld is the name of your domain.

 

it will apears some tables and in table named Configuration PHP Core you must look way below for line: memory_limit 512M (number is whatever you put)

 

 

3. Usually php.ini affect only directory where exist. So If you want php.ini to affect all subdirectories you must add in .htaccess those lines:

 

<IfModule mod_env.c>

SetEnv PHPRC /home/your_cpanel_username/php.ini

</IfModule>

* For your_cpanel_username you must put your user name for the control panel.

 

So that must work for you.

Edited by Beherit (see edit history)
  • Like 2
Link to comment
Share on other sites

hello

 

thanks for your solution, I really appreciate it!

 

im convinced that it will be really helpful for other community members

 

now i can go ahead and mark this thread as [solved]

 

thanks again

Link to comment
Share on other sites

  • 1 month later...

In 1.5.4.1 i solve the problem adding the following line to /config/config.inc.php

 

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

 

at the beginning of file, with other ini_set instruction.

 

my error message:

 

Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxx bytes) in tools/smarty/sysplugins/smarty_internal_templatelexer.php on line xxx

  • Like 5
Link to comment
Share on other sites

In 1.5.4.1 i solve the problem adding the following line to /config/config.inc.php

 

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

 

at the beginning of file, with other ini_set instruction.

 

my error message:

 

Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxx bytes) in tools/smarty/sysplugins/smarty_internal_templatelexer.php on line xxx

 

Hi, it maybe that your host does not allow you to do that. Do you have access to your php.ini file?

Link to comment
Share on other sites

  • 4 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...