Strange 500 internal server error with certain file
I'm using Smarty the PHP templating engine and up until now was doing pretty well with it. When I view my website now though I keep getting a "HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request."
What's weird is the minute I rename my template from index.tpl to header.tpl or anything else like ijustmadethisup.tpl I don't get the 500 error. I think somewhere along the line the code was invalid and caused the 500 error to occur but now it won't work at all unless I rename the template.
I suspect it is a caching issue but the template_c and cache folder that I use for my Smarty app are empty and I have turned caching off using…
$smarty->caching = Smarty::CACHING_OFF;
.
I'm fairly new to running my own server and I am not sure how to diagnose this issue. I've looked inside /var/log/messages and /var/log/apache2/access.log and /var/log/apache2/error.log but can see no obvious problems. I'm using Ubuntu 10.10.
Any help would be appreciated.
Thanks everyone.
4 Replies
Open /etc/php5/apache2/php.ini, scroll down a few hundred lines, and find a line that says "logerrors". Make sure that it's "On" (without the quotes). Also make sure that "errorreporting" is either "EALL" or "EALL | E_STRICT" (without the quotes). This ensures that no error goes unnoticed.
Restart Apache.
Errors will start appearing in /var/log/apache2/error.log or wherever you told your virtual host to point error logs at.