0
votes

I hav problem with my CakeFramework: Site does not work. Error log said:

[02-Aug-2016 04:57:45 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32 bytes) in /public_html/lib/Cake/Model/Datasource/Database/Mysql.php on line 185

This is line 185:

} catch (PDOException $e) {
        throw new MissingConnectionException(array( --- LINE 185
            'class' => get_class($this),
            'message' => $e->getMessage()
        ));
} (!)
    public function listSources($data = null) {

This is public function connect().

1
Maybe you're retriving a lot of data and PHP hasn't enough memory to handle it. Have you tried rising the max memory limit in php.ini? - Roberto Maldonado
The server has run out of memory and thrown an exception to tell you about it. How much data are you handling in the request, and can you reduce it? - Colonel Mustard

1 Answers

-1
votes

If the script you are using is borrowed from someone else make sure there is no ini_set('memory_limit', '256M') which would produce the exactly effect you are seeing in spite of any change you made in php.ini. or try this set_time_limit(0); Infinite in thecontroller.