php - CakePHP based Application throws 500 Server Error on requiring Cache-Class
I'm trying to run a CakePHP based Application. this is it: Newsletter Mailer v1.1
I'm trying to get this running here: mailer.dasministerium.com
But as you can see all I receive is a 500 Internal Server error.
I tracked this error down to file:cake/libs/cache.php
line 203
$core = App::core();
$path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
if (file_exists($path)) {
require $path;
return true;
}
where line 203 is:require $path;
To track this down I die()d befor this line, and got my die() message.
Die()ing after this line resulted in the 500 Error, but die()ing in that required file (cake/libs/cache/file.php
) gave me the 500 too.
So the whole thing is really crashing at that require thing.
I'm running Ubuntu 8.04 LTS 64Bit, PHP 5.2.4 (as apache module, NOT fast-cgi)
Any ideas how to get this running?
Thanks in advance! David
EDIT:
After printing out all errors into the error-file i found this:PHP Fatal error: Class 'CakeLog' not found in /var/www/vhosts/dasministerium.com/subdomains/mailer/httpdocs/cake/libs/cache/file.php on line 83
Unfortnunately there is no reference at all toCakeLog
in this file... so: wtf?!
EDIT 2:
var_dump(class_exists('CakeLog')); // this before the crashing
// require() returns true!
EDIT FINAL!
Its a CakePHP <-> eAccelerator issue.... SOLVED
Answer
Solution:
SOLVED: it was eAccelerator's fault. fixed it with a little hack...
Solution:
open
/cake/libs/cake-log.php
an scroll to the very bottom, then replacewith:
that's it :)
Answer
Solution:
That solution is for Cake1.3 (and newer maybe).
What about 1.2?
There is no line:
in cake_log.php file.
Answer
Solution:
I notice that cakephp 2.x may return http status 500 when there is no 'view' to the controller. It seems to be 'randomly occuring', as some Controllers without a view returns http status 200.
Anyway, to solve this http status 500 problem, ensure all your controllers has a view associated with it (you will see an error at the bottom of the page if there is no view associated with a controller).