Solved

Inconsistent Internal Server Error 500 on drupal install on some pages

Posted on 2008-10-02
21
2,317 Views
Last Modified: 2012-05-05
I have Drupal 6.4 installed on a GoDaddy account.  The Drupal install has worked great since day one ( a few months now) with Clean URLs enabled.  Today i go to the website and i get an error message that reads:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.33 Server at www.wildefuneralhome.com Port 80

-------------------------------------------------------------------------
This is exceedingly disturbing because just a day or so ago i was making a few changes; HOWEVER, everything was working fine.  

Even more interesting.  The Internal Server Error only shows when trying to access certain pages.  

If not logged in: if you go to the home page (www.wildefuneralhome.com) you can see the server error
but if you go to www.wildefuneralhome.com/user you can see the site is working!

if i am logged in (via wildefuneralhome.com/user) i can view the home page and successive pages such as http://www.wildefuneralhome.com/taxonomy/term/1 or http://www.wildefuneralhome.com/contact or even http://www.wildefuneralhome.com/tracker or http://www.wildefuneralhome.com/node/add/page PERFECTLY FINE.  

also not, for example.  That when i am logged in with the admin account i can view http://www.wildefuneralhome.com/tracker just fine.  However, when i'm not logged in, after viewing www.wildefuneralhome.com/user, viewing http://www.wildefuneralhome.com/tracker yeilds the 500 Internal Server error.  What gives?

Most importantly, I CANNOT access http://www.wildefuneralhome.com/admin and thus i am at a loss as to what to do.  

I had not modified the base .htaccess file prior to this happening.

check it out for yourself.  go to www.wildefuneralhome.com then go to www.wildefuneralhome.com/user
The website is currently in maintenance mode; thus you should only be able to access basic pages unless you log in.

I have tried downloading a fresh install of drupal 6.4 and uploading & replacing the base files including the .htaccess file to the server.  This yeilded NO CHANGE.

I also tried installing a backup of ALL the theme files and folders i have been modifying from weeks ago (thus these files were all from WEEKS before this problem started happening). This also yeilded NO CHANGE.  

Thus i am led to believe it has to be someting with the server; however calling GoDaddy has only led to dead ends and them blaming scripting errors and advising i ask Drupal for help.  But i don't recall doing anything to the code that would have caused this.

This is a very urgent problem.  Any advice or help would be greatly greatly appreciated!!

feel free to ask me questions i'll do my best to be as thorough as possible,

Thanks in advance
0
Comment
Question by:LeftHandedPants
  • 11
  • 10
21 Comments
 
LVL 9

Expert Comment

by:khaledf
ID: 22630889
can u attach the error log here?
0
 

Author Comment

by:LeftHandedPants
ID: 22630909

Thanks for the reply...

I would love to but because my website is on a shared hosting account with GoDaddy i can not access the server's error log.  

or

Are you referring to a different error log?
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22630922
ftp to your site and check if you have a folder called logs, their has to be an error log,
if you can't find one, use the control panel they have provided to get error log.
it is a log  created by apache.
0
 

Author Comment

by:LeftHandedPants
ID: 22630962
i am finding no error, or log files or folders in my FTP directories.
neither am i finding any such logs in the GoDaddy hosting manager.

In drupal there are access logs, error logs, etc.  However the only way i know to view these are via the web interface after logging in as the ADMIN.  The admin pages, however, are the pages that give the internal server error, so this will not work to view the error logs.

...perhaps i can find an error log table in the database.  I'll look into that and get back to you asap.

also, i'd be willing to grant someone temporary FTP access to the PHP files if you have enough time to commit to this
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22630997
check this article http://help.godaddy.com/article/1198 and see if you can find the location of error log
0
 

Author Comment

by:LeftHandedPants
ID: 22631028
Thanks.

After going to that exact part of the hosting control panel mentioned in the Article, there is no option marked "error logs."  

That article says "NOTE: This article only applies to Deluxe and Premium hosting accounts running Hosting Configuration 2.0."
HOW STUPID, i guess i have to pay extra just for some error logs!?
Unfortunately i have GoDaddy's Economy Hosting account.  I can not believe they would exclude error logs from this.  How rediculous.  Is my only option to upgrade to a more expensive hosting plan just so i generate more internal server 500 errors to log them?

I wont hesitate to call them and complain about this or request some sort of error log information.

I have to turn in for tonight but i will be back in touch tomorrow. thanks again for your responses!
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22631055
to save time, I guess you should send them an email to get the error log location. I don't think they will hide it it should be there even in very cheap hosts.
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22631128
let me know when you get a response from them.
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22631145
check this link http://help.godaddy.com/article/2372 can you find anything?
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22631154
and to do some tests, try to rename .htaccess files, does it work when renamed?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:LeftHandedPants
ID: 22641700
thanks for your responses.  I talked to them again.  Again they said that it is "ABSOLUTELY IMPOSSIBLE" for me to view any sort of server or system error logs for my website, unless it is on a dedicated server.

thus i have been doing some tests.  I did try renaming the .htaccess files,  i also tried deleting it completely (led to highly undesired results), i also tried replacing it with a fresh .htaccess file from the drupal 6.4 download from drupal's website.  All these had no effect on getting rid of the internal server error when view the admin page(s).

Thus, i believe it must have to do with some file, or included file, or scripting error in a theme file or something somewhere.  I can't for the life of me think of a related significant file i may have edited to make this happen, however, i'm trying to do tests to narrow it down.  I'll let you know how they turn out.

Do you agree?

Do you have any other ideas?

Thanks for your help
0
 

Author Comment

by:LeftHandedPants
ID: 22641716
here's what my current .htaccess file looks like:
#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $


I did try uncommenting the line:
  # RewriteBase /
however that had no effect either.  Not to mention, from my understanding, that only applies to if drupal is installed in subfolders.


Also, clean urls and ModRewrite, etc IS WORKING.  Like i said, when i log in i can go to pages that were created such as http://www.wildefuneralhome.com/contact or http://www.wildefuneralhome.com/tracker just fine and it DOES NOT use the ?q=, thus the rewriting stuff is working.  Its only when i try to go to http://www.wildefuneralhome.com/admin or if im' not logged in that this happens.  

I'll figure this out eventually, i have to.  Thanks for any advice...




0
 
LVL 9

Assisted Solution

by:khaledf
khaledf earned 100 total points
ID: 22641747
without apache error log it would be extremely difficult and time consuming to track down the cause of the error.

I think GoDaddy sucks for their response. how can't they provide error log for your website?!!

open a support ticket and let them convince you that it is scripting error. let them mention the error message that says so.

if i were in your position I'll move to another hosting company.

 
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22641904
create a file called info.php that contains the attached code

access the file e.g www.example.com/info.php
then save it and attach it here.

maybe this would help narrowing the possibilities.
<?php

phpinfo();

?>

Open in new window

0
 

Author Comment

by:LeftHandedPants
ID: 22643416
WOW great suggestion.  I did a few tests today.  I'll do your suggestion and notify you about the tests i've done tomorrow as soon as i can.
0
 

Author Comment

by:LeftHandedPants
ID: 22646656
Okay so here's some news.
Here are the a few of the experiments i've done:

I have tried overwriting the theme files with ones that were backed up a few months before this started happening
NO CHANGE- thus i reverted this

I have tried overwriting the base drupal files such as .php with "fresh" ones from drupal.org
NO CHANGE- thus i reverted this

I have tried copying this drupal installation to a new server which will give us clues.  i moved over all drupal files and the database, etc. Every thing seems to match up on the new temp server.
This no longer yields a 500 internal server error, all seems to function correctly and i can now access the ADMIN pages, etc, on the new server. so far EXCEPT a few errors spit out from drupal:

Warning: Invalid argument supplied for foreach() in /home2/schwebde/public_html/wfh/includes/theme.inc on line 443

Warning: Invalid argument supplied for foreach() in /home2/schwebde/public_html/wfh/includes/theme.inc on line 448

I'm not sure if this is what is causing the 500 internal server error on the ORIGINAL server or not, nor how to fix it.  I will experiment with replacing theme.inc for example with a fresh version, but haven't done that yet.

On the new server cron does run manually but doesn't return to the Status Report page, rather just leaves you on the blank page with the two errors above.

I have put info.php on each server.  Check out
Original server: http://www.wildefuneralhome.com/info.php
temporary other server: http://www.schwebdesign.com/wfh/info.php
any thoughts?

A plus that things are working a bit better on the new server is that i can access drupals error logs.  
I have created a new user account so you can log in to the COPY of this drupal install on the new TEMP server and view the error logs that drupal saved.

just go to www.schwebdesign.com/wfh/user
Log in with username: experthelper
password: temp
then go to the logs at: http://www.schwebdesign.com/wfh/admin/reports/dblog
things seem to go awry at the log entry for 10/01/2008 - 13:00

So, there's some information.  Any thoughts?  I'll keep you updated...

so far on my new server (which is at hostmonster- a heck of a lot better than godaddy) there are NO error logs relevant to what i just installed at www.schwebdesign.com/wfh

looking forward to your reply
0
 

Author Comment

by:LeftHandedPants
ID: 22646788
stuff being passed doesn't seem to work on new server.  but they do sometimes

for example when i logged in as administrator on the new server,  it took me to a page with the address:
http://www.schwebdesign.com/wfh/admin?destination=admin but it was just a blank page with the error messages on it.
i then went back to the admin page by going to http://www.schwebdesign.com/wfh/admin

and it had successfully logged me in but there was a new error message shown:
# warning: Cannot modify header information - headers already sent by (output started at /home2/schwebde/public_html/wfh/includes/theme.inc:443) in /home2/schwebde/public_html/wfh/includes/session.inc on line 101.
# warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home2/schwebde/public_html/wfh/includes/session.inc on line 104.

whatever, i don't care if these are irrelevant to the situation on the other server.  I essentially want to figure out what is causing the 500 internal server error on the original server.

i wish i could figure out what those error messages left.  so far google searches aren't helping.

replacing the includes/theme.inc file with a "fresh" one yeilded no change.
0
 

Accepted Solution

by:
LeftHandedPants earned 0 total points
ID: 22646990
good news.  i just tried 2 more experiments.

first i tried (after backing up all files and db for drupal) uploading the backed up drupal files from way before this all happened and nothing changed and overwriting the files currently on the server
the 500 internal error still came up.

so i deleted every single file on the server except the settings and default.settings.php files.
then i uploaded all the files (same as experiment above) from the previous backup to the server.

This fixed the problem.

After logging in i saw Cron was having problems, had been running for " more than an hour"... probably more like days.  regardless i treid to run it manually a few times till it finally worked.  now the website seems perfectly fine.


... i just hope it doesn't happen again...

...i wish i could've figured out why the cron got stuck running....
...i wish i could've figured out what caused it all.   goodness....

that being said... YAY... i'll still look forward to hearing your thoughts
0
 
LVL 9

Assisted Solution

by:khaledf
khaledf earned 100 total points
ID: 22647172
First of all, Congrats for getting your site working again.
secondly,  big THANKS for putting your findings here so others may find it very useful.

It is very likely that a cron job got stuck due to memory limit being not sufficient.
if the problem happens again check your memory_limit in php
set it to memory_limit = 128M like your temp site has http://www.schwebdesign.com/wfh/info.php

0
 

Author Comment

by:LeftHandedPants
ID: 22681878
Thanks again for all your advice.  Indeed, i hope this post helps others work similar problems out.

Thanks for the advice regarding the php memory limit.  I will keep a close eye on that.

At the moment, however, i'm thinking it had to be some scripting error.  

I'm not sure what to do at this point.  I feel you deserve points for helping me, even though I technically fixed it myself.  

...not to mention i need the remaining points to ask yet another question.  Thanks again!
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22682097
Not at all LeftHandedPants, the points are not that much important for me, satisfaction and credit is the most important. Also the question and analysis done by you makes it a good reference.

wish you all the best.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Responsive Design Tools 6 38
Paging Using PHP 7 32
Programatically extract date from website 8 17
masking php string 4 0
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Creating and Managing Databases with phpMyAdmin in cPanel.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now