CakePHP - Apache has Stopped Responding

I've been developing a new application with CakePHP 1.2.5 and came across a really frustrating problem, which admittedly is entirely my own fault but took me ages to troubleshoot and find the source of the problem.

I'm using Xampp and Windows 7 and this problem was causing Apache to stop responding and completely crash. Quite strange behaviour for a simple application I've just started, so I started searching online for similar problems. A few were suggesting that Zend optimizer was the problem but I don't have it installed so I started debugging the code and seeing where the problem was.

Cutting a long and hair-pulling story short the problem was this piece of code:

$this->Session->setFlash('You have successfully logged in','flash_good');

Where did I go wrong? Well I hadn't created the "flash_good.ctp" layout file, one missing layout and the app was causing Apache to stop responding and crash. Now CakePHP is usually extremely good in letting you know any missing files, so I'm not sure if this is a problem with my setup or that if this was overlooked. Either way when this happens again this is the first place I'm looking.

Had similar problems? Let me know in the comments!

Posted on 25th October 2009
9 years, 3 months, 4 weeks, 2 days ago

comments powered by Disqus