1.5.5b,PHP Version: 5.6.28 MySQL 5.6.34
Got the following error,i could not figure it out what's going on and where i made a mistake.
Allowed memory size of 134217728 bytes exhausted includes/functions/functions_general.php on line 62
.........
1.5.5b,PHP Version: 5.6.28 MySQL 5.6.34
Got the following error,i could not figure it out what's going on and where i made a mistake.
Allowed memory size of 134217728 bytes exhausted includes/functions/functions_general.php on line 62
.........
Line 62 is running a PHP function to parse some data, and it would seem that the data is massive in size.
Most of the time that code is triggered by the zen_output_string_protected function, which takes data entered by the user and outputs it to the screen after sanitizing it to be sure malicious content hasn't been inserted or can't be exploited.
Thus it suggests that your out-of-memory situation is a result of either receiving a *very* large amount of data from the user, or have a *very* large amount of data you're trying to output.
I'm pretty sure it's a result of something you've altered your store to do, or plugins you've added. It's not something that occurs during normal Zen Cart use.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks for your reply,i used the folllowing php code to check memory usage,i got 218.3515625 kb ,can i solve the problem temperately if i increase it to 2GB,the allowed memory now is 128MB
PHP Code:
<?php
function get_usage_in_kb(){
echo memory_get_usage()/1024.0 . " kb \n";
}
class Profiler
{
protected $startTime = 0;
public function timerStart(){
$this->startTime = microtime(true);
}
function timerEnd(){
echo number_format( (microtime(true) - $this->startTime)*1000, 2 ), ' ms';
}
}
class ProfilerHolder {
protected $profiler;
public function __construct( Profiler $profiler ){
$this->profiler = $profiler;
}
}
ini_set('memory_limit', '1M');
$profiler = new Profiler();
$profiler->timerStart();
get_usage_in_kb();
$holder = new ProfilerHolder( $profiler );
$b = null;
/**
* @return string
*/
function make_dummy_data()
{
return str_repeat( "Hello|", 114242 );
}
$a = make_dummy_data();
$data = explode( '|', $a ); // comment this after narrowing down that a lot of memory is being used here
//$data = array(); // uncomment this and memory usage will drop
$buffer = array();
foreach( $data as $key => $item ){
$buffer[] = $item;
}
get_usage_in_kb();
unset($a);
get_usage_in_kb();
echo memory_get_peak_usage(TRUE)/1024, ' kb', "\n";
$profiler->timerEnd();
unset( $profiler );
xdebug_debug_zval( 'profiler' );
//var_dump( $holder );
Nowadays a typical server is set to PHP Memory Limit = 256 MB
Suggest the server you are on be changed to use that or, if that not possible, change it in the php.ini file for your hosting account if you have one.
Normal Zen Cart operation wouldn't require more than 32M or maybe burst to 64M.
You need to narrow down exactly what you were doing when the problem was triggered. A complete stack-trace would be helpful, instead of just the line number of the last step.
You also still haven't listed all the ways in which your site differs from original Zen Cart code.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Thanks very much for your help ,I update my zencart from 1.3.9 to 1.5.5b,here is what i am doing:
upload zencart 1.5.5a file and install to update the website,when promote update, i just updated it. Am i missing anything?it seems i did not update the database from 1.5.5a to 1.5.5b,i just update some files...
Zen Cart 1.5.5b
Database Patch Level: 1.5.5
v1.5.5a [2016-07-07 22:11:43] (Version Update 1.5.4->1.5.5a)
v1.5.4 [2016-07-07 22:11:39] (Version Update 1.5.3->1.5.4)
v1.5.3 [2016-07-07 22:11:38] (Version Update 1.5.2->1.5.3)
v1.5.2 [2016-07-07 22:11:36] (Version Update 1.5.1->1.5.2)
v1.5.1 [2016-07-07 22:11:34] (Version Update 1.5.0->1.5.1)
v1.5.0 [2016-07-07 22:11:32] (Version Update 1.3.9->1.5.0)
v1.3.9f [2011-11-21 16:38:07] (Fresh Installation)
v1.3.9f [2011-11-21 16:38:07] (Fresh Installation)
The funny thing right now is i got a new memory problem at the following address
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes) in /home/estanda1/public_html/includes/classes/db/mysql/query_factory.php on line 45
It's not really a new message, just an indication that 1) increasing the memory size didn't solve anything and 2) that there remains something causing a problem.
So, when you described the process of upgrading, did the new ZC 1.5.5 files get put into their own clean empty directory, or did they overwrite other files in the directory? Reason I ask is because of the potential of various php files that may have remained behind or be causing some of the issues seen.
Typical question to assist identifying the cause is: how is the fileset of your store different from a vanilla install of that version of the store? What extra files are there? What files are missing, how are they modified?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks