Class CakeLog not found
Reported by Robert Meisner | June 13th, 2010 @ 04:16 AM | in 1.3.3
After upgrade to 1.3.2 i encountered strange problem on
production server.
Permissions correct, debug=2, then i switched to debug=1;
First thing i saw was :
500 Internal Error
The server encountered an internal error and could not complete
your request.
After some code digging i hacked core and set displaying errors on (for debug=0);
Then i could see real problem:
PHP Fatal error: Class 'CakeLog' not found in
/cake/libs/cache/file.php on line 83
call stack: [#0](/projects/42648/tickets/0 "Ticket #0") File->__construct(//app/tmp/cache//cake) called at [/cake/libs/cache/file.php:83] [#1](/projects/42648/tickets/1 "Ticket #1") FileEngine->init(Array ([engine] => File)) called at [/cake/libs/cache.php:151] [#2](/projects/42648/tickets/2 "Ticket #2") Cache->_buildEngine(default) called at [/cake/libs/cache.php:126] [#3](/projects/42648/tickets/3 "Ticket #3") Cache->config(default, Array ([engine] => File)) called at [/app/config/core.php:302] [#4](/projects/42648/tickets/4 "Ticket #4") include(/app/config/core.php) called at [/cake/libs/configure.php:391] [#5](/projects/42648/tickets/5 "Ticket #5") Configure->__loadBootstrap(1) called at [/cake/libs/configure.php:52] [#6](/projects/42648/tickets/6 "Ticket #6") Configure::getInstance() called at [/cake/bootstrap.php:38] [#7](/projects/42648/tickets/7 "Ticket #7") include(/cake/bootstrap.php) called at [/app/webroot/index.php:76]
as i understand File constructor throws some kind of error,
which is suposed to be logged by CakeLog class, which cannot be
found.
Seems this problem is strongly connected with server's configuration,since its working all fine on my Mamp instalation, but not on production (which i hardly can configure in any way, still its one of the most popular hosting companies in my country).
Seting Configure::write('log', false); in core.php
is workaround, but i loose needed functionality on production this
way (loging errors).
Comments and changes to this ticket
-

ronin-89541 (at lighthouseapp) June 17th, 2010 @ 04:46 PM
I had exaclty the same problem and in my case it was eAccelerator.
If your company is using it (use phpinfo() to find out), try this:At the top of config/core.php
if ((int)ini_get('eaccelerator.enable') == 1)
{ ini_set('eaccelerator.enable', 0); ini_set('eaccelerator.optimizer', 0); }After that, the problem went away.
-

Mark Story June 20th, 2010 @ 07:32 PM
- → Milestone set to 1.3.2
- → Tag changed from cakelog class not found, class not found, not found, cakelog to not found, cakelog, defect
- → State changed from new to hold
I would need more information to reproduce, as I haven't run into that one before, and it sounds like an intermittent issue.
-

Arek Dziki June 21st, 2010 @ 07:52 AM
I have exactly the same problem and Jorgelin workaround is not working for me.
But this code modification works OK:
file: cake\libs\cake_log.php
from:
if (!defined('DISABLE_DEFAULT_ERROR_HANDLING')) { set_error_handler(array('CakeLog', 'handleError')); }to:
if (!defined('DISABLE_DEFAULT_ERROR_HANDLING')) { $cakeLog =& CakeLog::getInstance(); set_error_handler(array(&$cakeLog, 'handleError')); }But I don't know, how it affect final performance?
-

Mark Story July 3rd, 2010 @ 05:27 PM
This patch seems wrong as its going to call a static method on an instance. Are you using APC by any chance?
-

Arek Dziki July 5th, 2010 @ 03:38 AM
This problem occurs only on production server, and there is installed mysterious "IdeaCache" which could be something like APC.
I am in touch with my provider's support and trying to learn more about this. -

-
euromark July 19th, 2010 @ 06:01 AM
this seems to be related to my ticket:
http://cakephp.lighthouseapp.com/projects/42648/tickets/923-cakephp... -

Mark Story July 19th, 2010 @ 10:04 PM
- → State changed from hold to duplicate
Closing this one as duplicate, as the other ticket #923 more concisely documents the issues using eAccelerator causes.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
Repository is at http://github.com/cakephp/cakephp
Creating a bug report
When creating a bug report, please include as much relevant information as possible. Please include code to reproduce the issue. Or even better, make a unit test. Either change an existing test or add a new test to show that the expected behavior is not occuring.
People watching this ticket
Attachments
Referenced by
-
#923 CakePHP1.3.2 crashes with eAccelerator running
Also see #817