Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Dec 28, 2011 9:48 pm 
Offline
Senior Newbie

Joined: Wed Apr 27, 2011 7:54 am
Posts: 11
Perhaps you can help me? I have an unusual issue with a particular 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...

Code:
$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.


Top
   
 Post subject:
PostPosted: Wed Dec 28, 2011 11:07 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Check Apache's error log, what does it say about the 500 error?


Top
   
 Post subject:
PostPosted: Thu Dec 29, 2011 2:13 pm 
Offline
Senior Newbie

Joined: Wed Apr 27, 2011 7:54 am
Posts: 11
Where do I find Apache's error log? I thought it would be here /var/log/apache2/error.log but I couldn't find anything related to a 500 error.


Top
   
 Post subject:
PostPosted: Thu Dec 29, 2011 4:42 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
It's possible that PHP is not configured to send errors to Apache.

Open /etc/php5/apache2/php.ini, scroll down a few hundred lines, and find a line that says "log_errors". Make sure that it's "On" (without the quotes). Also make sure that "error_reporting" is either "E_ALL" or "E_ALL | 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.


Top
   
 Post subject:
PostPosted: Tue Jan 03, 2012 3:28 am 
Offline
Senior Newbie

Joined: Wed Apr 27, 2011 7:54 am
Posts: 11
hybinet - Thanks so much for this tip it's proved really useful and helped me find out where the problem was coming from.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group