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!
Comments
Ivan (25/10/2009 - 08:34)
Actually, had this problem over a year ago and it still isn't fixed. Also if you run the console in Vista without admin privileges it crashes Apache to the point that I need to reinstall it!
Arthur (25/10/2009 - 12:48)
There's a ticket for that bug, but it says it was fixed a year ago. (At least, they wrote a test that "disproved" the bug exists.)
https://trac.cakephp.org/ticket/4798
Brendon Kozlowski (28/10/2009 - 11:52)
I've had a similar problem when trying to use the SimpleTest framework. I created new fixtures for a completely new test for the models. When I instantiated the fixture, Apache crashed. I could not verify exactly where the issue itself was caused, and no one else was able to offer some advice. The test was simply to prove or disprove proper usage of CounterCache as I believe it actually can be used incorrectly - but I didn't want to update the Cookbook entry without proof. I spent over 2 weeks on it and ultimately decided it wasn't worth pursuing further.
Ross (01/11/2009 - 22:48)
I had the same problem. Not cool.
pcp (25/11/2009 - 01:26)
I had the same problem but my apache did not stop responding. CakePHP did not point me to the error. I was getting just getting an infinite loop creating missing layout frames. I'm running ubuntu jackalope here though.
dogmatic69 (07/08/2010 - 12:36)
ive had something like this, never found out what the problem was and think i finally binned the whole project and started over. running vista and xampp. was about a year ago, and never had it again though.