0

In an error log file on my server are some errors of this kind :

  • PHP Fatal error: Allowed memory size of 268435456 bytes exhausted
    (tried to allocate 86 bytes) in ....(a php file, on line..)
  • PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2 bytes) in ....(a php file, on line..)

For every error the recommended allocate bytes amount is lower than 100 bytes.

Does it mean that an increase of memory of only 100 bytes would solve every problem ?

How could I know what script is responsible for so much memory usage ?

My shop is built with Prestashop 1.5.6.2.

The full error message that I get is the following :

Allowed memory size of 268435456 bytes exhausted (tried to allocate 92 bytes) in ../classes/db/DbPDO.php on line 101

The line 101 is as follows :

return $result->fetch(PDO::FETCH_ASSOC);

This line is part of the following code :

    public function nextRow($result = false)
{
    if (!$result)
        $result = $this->result;
    return $result->fetch(PDO::FETCH_ASSOC);
}

I am not a developer and I thank you in advance for any help in this matter.

Patrick

I thank you in advance for any reply.

Patrick

user3278588
  • 81
  • 1
  • 12
  • 2
    No! The best way to solve the problem is to work out why the script needs so much memory, and then change the way it works so that it doesn't require that much any more – Mark Baker May 03 '17 at 19:26
  • Unfortunately, I am not a developer. What could I do to know why the script need so much memory ? Thank you advance. – user3278588 May 06 '17 at 19:16

1 Answers1

1

No. You need to increase you PHP memory limit. You can do this by adding the following code to the top of your file

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

Or increasing it in your php.ini file

memory_limit = 512M;

If you don't have access to that you can add this to your .htaccess file

php_value memory_limit 512M
Mike
  • 189
  • 1
  • 2
  • 18