Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Mysqli.php Error - Fatal Error: Out Of Memory Rate Topic   - - - - -

 
  • minute
  • Junior Member
  • Members
  • Join Date: 21-Feb 11
  • 147 posts

Posted 01 September 2015 - 06:40 AM #1

Fatal error: Out of memory (allocated 25952256) (tried to allocate 1561 bytes) in /home/anemona/public_html/app/Tygh/Backend/Database/Mysqli.php on line 88

 

Hello,

 

I have this error on my website, it appear from time to time. I report it to my hosting service (I have a VPS) and they increase the php memory_limit to 512Mb, but the problem persists.

 

I have cs-cart 4.3.2., I had the previous version and I just made the update, but the error is still here.

 

Please help me, my customers are unable to finish an order. 

 

This error appear about 3 days ago, I did not do anything, I did not install anything, etc...

 

The lines 79-92 from the file:

 

    /**
     * Fetches row from query result set
     * @param  mixed  $result result set
     * @param  string $type   fetch type - 'assoc' or 'indexed'
     * @return array  fetched data
     */
    public function fetchRow($result, $type = 'assoc')
    {
        if ($type == 'assoc') {
            return $result->fetch_assoc();
        } else {
            return $result->fetch_row();
        }
    }

My config.local.php has the following lines:

// Set maximum memory limit
if (PHP_INT_SIZE == 4 && (substr(ini_get('memory_limit'), 0, -1) < "64")) {
  // 32bit PHP
  @ini_set('memory_limit', '512M');
} elseif (PHP_INT_SIZE == 8 && (substr(ini_get('memory_limit'), 0, -1) < "256")) {
  // 64bit PHP
  @ini_set('memory_limit', '512M');
}

if (!defined('CONSOLE')) {
    // Set maximum time limit for script execution.
    @set_time_limit(3600);
}
 

I tried to change it to 64/128/256... all the combinations, no changes!

 

Thanks!



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 23049 posts

Posted 01 September 2015 - 08:28 AM #2

Try to put this line:

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

before this one:

if (!defined('CONSOLE')) {

So the line should not be in the if..else.. part of code


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • minute
  • Junior Member
  • Members
  • Join Date: 21-Feb 11
  • 147 posts

Posted 01 September 2015 - 09:03 AM #3

I put:

// Set maximum memory limit
if (PHP_INT_SIZE == 4 && (substr(ini_get('memory_limit'), 0, -1) < "64")) {
  // 32bit PHP

} elseif (PHP_INT_SIZE == 8 && (substr(ini_get('memory_limit'), 0, -1) < "256")) {
  // 64bit PHP
  @ini_set('memory_limit', '512M');
}

  @ini_set('memory_limit', '512M');
if (!defined('CONSOLE')) {
    // Set maximum time limit for script execution.
    @set_time_limit(3600);
}

and

// Set maximum memory limit
if (PHP_INT_SIZE == 4 && (substr(ini_get('memory_limit'), 0, -1) < "64")) {
  // 32bit PHP
@ini_set('memory_limit', '512M');
} elseif (PHP_INT_SIZE == 8 && (substr(ini_get('memory_limit'), 0, -1) < "256")) {
  // 64bit PHP
  
}

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

if (!defined('CONSOLE')) {
    // Set maximum time limit for script execution.
    @set_time_limit(3600);
}

No changes on the first variant, the secondvariant is worse!

 

Thanks!