|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
CrazyTemplate Smarty Rookie
Joined: 12 Sep 2011 Posts: 31
|
Posted: Wed May 21, 2014 11:30 pm Post subject: End of script output before headers |
|
|
I have a strange problem and I'd appreciate some help.
I'm using a Smarty template, which loops on a multi-dimensional array and returns a large (50+) set of tables in HTML format.
Everything seems to work, but one out of 5 requests, the user is returned with a blank page. The apache error log shows the following error: End of script output before headers. Unfortunately, there are no PHP errors reported, nothing in the error_log.
After some tracing, I found out that the PHP script dies at the very last command, which is: $smarty->display('search.html');
Since there are no errors reported by Smarty, or PHP, I can't really trace the problem to the offending code.
I know this is not due to a memory error, since I've raised the PHP memory limit to several gigs and I've also enabled the error_log reporting, which works for regular PHP and Smarty errors (just not in this case).
So what would cause the PHP/Smarty process to die without any errors, on a script that otherwise works fine for smaller data sets?
Please help.
Thank you.
PS:
I did manage to figure out, that the problem is in a single line, which contains two {if} statements, one {foreach} and some isset() calls to an array with 2000 records (strings of company names). Probably something breaks when accessing the large array with isset(). I re-wrote the code into more lines and now the Smarty display() process does not die. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|