Beherit Posted May 30, 2013 Share Posted May 30, 2013 (edited) 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 May 30, 2013 by Beherit (see edit history) 1 Link to comment Share on other sites More sharing options...
Beherit Posted May 30, 2013 Author Share Posted May 30, 2013 (edited) 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 May 30, 2013 by Beherit (see edit history) 2 Link to comment Share on other sites More sharing options...
vekia Posted May 30, 2013 Share Posted May 30, 2013 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 More sharing options...
francesco1983 Posted July 2, 2013 Share Posted July 2, 2013 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 5 Link to comment Share on other sites More sharing options...
benjamin utterback Posted July 2, 2013 Share Posted July 2, 2013 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 More sharing options...
francesco1983 Posted July 2, 2013 Share Posted July 2, 2013 No, i'm not Link to comment Share on other sites More sharing options...
benjamin utterback Posted July 2, 2013 Share Posted July 2, 2013 Adding that line in your config.inc.php file won't do the trick then. What is your memory set to at the moment? Link to comment Share on other sites More sharing options...
francesco1983 Posted July 2, 2013 Share Posted July 2, 2013 the phpinfo() reports a memory_limit set to 64M, the error message that i had report a value of allowed memory size very higth, about 228MB, (the tried to allocate was about 122Kb). I don't understand this high value. Link to comment Share on other sites More sharing options...
benjamin utterback Posted July 2, 2013 Share Posted July 2, 2013 Is your store resource intensive? There may be other reasons that you can fix to solve this problem. How many products/pictures do you have? How many combinations etc... Any third party modules? Link to comment Share on other sites More sharing options...
francesco1983 Posted July 2, 2013 Share Posted July 2, 2013 no, i'm just install it, there are only the sample date Link to comment Share on other sites More sharing options...
taoufiqaitali Posted July 28, 2013 Share Posted July 28, 2013 no, i'm just install it, there are only the sample date add this ini_set('memory_limit', '512M'); to this file config.inc.php exist via ftp in config folder maybe that help Regards, Taoufiq 4 Link to comment Share on other sites More sharing options...
vekia Posted July 28, 2013 Share Posted July 28, 2013 hello this code was mentioned above, moreover author of this thread solved problem with the same code. im closing this topic. regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts