“Premature end of script headers” with baked views
After deploying a simple application baked with the bake script I noticed a strange effect: requesting the index or edit action caused the following error: “Not found - The requested address internalerror.html was not found on this server.”. And the error log of Apache contained this error: “Premature end of script headers: php5.cgi”. Strange, it worked fine on my local server…
After some debugging I could locate the line which caused the problem:
<?php echo $html->link(__('Delete', true), array('action'=>'delete', $entry['Entry']['id']), null, __(’Are you sure you want to delete’, true).’ #’ . $entry['Entry']['id']); ?>
Or more precisely:
__('Are you sure you want to delete', true)
Don’t ask me why that doesn’t work on Dreamhost ;-)
As I don’t need multi-language support, the workaround is simple:
<?php echo $html->link(__('Delete', true), array('action'=>'delete', $entry['Entry']['id']), null, ‘Are you sure you want to delete #’ . $entry['Entry']['id']); ?>
Maybe this will help someone…




I noticed this in one of the google group posts as well. http://groups.google.ca/group/cake-php/browse_frm/thread/cf9a793ddfad1e6a/8c0cf50150895283
The guy there thought it had to do with the Zend Optimizer? Seems kind of weird though.
I can confirm that:
had that very same issue at the German hosting provider HostEurope and there it was the ZendOptimizer causing the problems, as well.
@theman, carsten: Thanks for the hint that ZendOptimizer could be the problem.
I am on dreamhost and had the same problem. It is Zend Optimizer v3.2.2. I found a post the said that Zend Optimizer 3.2.6 no-longer has that problem.
http://www.zend.com/forums/index.php?t=msg&goto=7323&S=f987dc025b5261de2b20e8
I have made dreamhost aware of this. They said they will be upgrading Zend Optimizer “in due time”
The other option to get around it is to compile your own copy of PHP with the newest version of Zend Optimizer.
@petersendidit: Thanks for the link.
Yeah, I got the same answer from Dreamhost. At the moment I will work with the workaround I described, as I am too lazy to compile my own version of PHP ;-)
Thanks, I’m also on dreamhost and was pulling my hair out. Didn’t realize dreamhost would allow you to compile your own php.
@farmer: Yes, they describe it somewhere in the wiki (http://wiki.dreamhost.com) how to compile your own PHP. Good luck with it :)
Hey cakebaker,
I deleted all the code out of my view and it is still throwing this error what would you suggest i do to fix it.
@bleevo: Hm, maybe you are using a helper which uses this function? Difficult to say what causes this problem in your case…