I have a drupal installation up on bluehost. There has been absolutely no code changes on for more than 3 weeks. This morning all of a sudden, out of the blue, it started showing up 500 internal server errors on most the the php pages. All static pages like .html and .txt show up fine, and so do some php pages like phpinfo.php

Errors Look like these:
Premature end of script headers: /home/asd/public_html/index.php
Too late to run INIT block at perl//CGI/Alert.pm line 108
etc..

I have seen a few other people on this forum have this same problem, but haven't seen a resolution.

Bluehost did upgrade their php version to 4.4.6 but that was about a week ago and the "500" errors started showing up just this morning

And we havent touched the code in 3 weeks and the local copy of our site works on our local machines

Comments

yaman’s picture

I just wanted to chip in that my site has the same exact problem and the same exact circumstances. I have been running the website with no changes to code for almost 6 weeks now, but when I checked it this morning many of the pages began showing 500 errors. However, some of them work. For example:

http://www.aelme.org/ (main page, WORKS)
http://www.aelme.org/about-aelme (a page, WORKS)
http://www.aelme.org/israel (a node listing, WORKS)

http://www.aelme.org/donate (a page, DOESNT WORK)
http://www.aelme.org/syria (a node listing, DOESNT WORK)

I should emphasize that the vast majority of these pages do NOT work.

I contacted BlueHost to report it and this is what they responded to me:

There is a problem with your .htaccess file I have spent quite I bit of time trying to fix it but with web friendly urls they are vey specific you are going to need to look at drupal support forums. The problem is not a server related problem.
Please let me know if you have further questions.

However, I'm pretty sure this is not the problem. I tried looking through the forums and none of the htaccess 'fixes' apply to me.

Anybody have any ideas? I'm still convinced the error is on BlueHost's side, but I don't know how to isolate the problem.

yaman’s picture

Do you have multiple domains used on the same account? Is the one with Drupal in a subfolder, and the one in the main domain a different system with its own rewrite rules? I'm just trying to isolate the problem because I was told rules in an htaccess file will supercede any rules in htaccess files in subfolders.

wallbay1’s picture

I just installed drupal I use www.hostingpacific.com
this is what i get
Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
www.hhreinvestment.com
Sat Aug 25 00:13:55 2007
Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.1 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4

mdlueck’s picture

Works for Me, that is: www.hhreinvestment.com

(shrug)

Hey hey, Apache2 ala Debian, very nice.

JohnForsythe’s picture

Seems to be a common issue at bluehost:

http://www.bluehostforum.com/showthread.php?t=7155
http://www.bluehostforum.com/showthread.php?t=7585

The error doesn't appear to be anything to do with Drupal or .htaccess.

--
John Forsythe
Need reliable Drupal hosting?

marcbe’s picture

Bluehost updated their PHP to 4.4.6 and it dates from the 3rd of April from what Drupal logs tells me.

So far, it only seems to affect the "Views" module. If I edit a view in the Views module, here is what I get on top of the page:

warning: Invalid argument supplied for foreach() in /mywebsitepath/includes/form.inc on line 945.

If I do any modifications on that view, It corrupts the database and data is lost. It says that my DB is corrupt.

On http://drupal.org/node/270, there are mentions of requirements regarding PHP (section 2 and 3). Maybe they changed something regarding these?

I saw there is a newer version of the view module, I tried to upgrade it and see if it resolves the problems... the problem still persists.

Anyone made other discoveries regarding these issues?
Thanks

Memeshift’s picture

I had the same problem.

After a few minutes with a friendly consultant at Bluehost, he tried commenting out the "FilesMatch" directive. It worked.

In .htaccess he changed it to look like this:

# 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>

Morgan Sully
Online Community Building
Digital Storytelling
Electronic Music
www.memeshift.com

"If you have knowledge, let others light their candles in it." - Margaret Fuller

cfoxgroverdrupal’s picture

Dreamhost is claiming it is Drupal's problem not dealing with their recent upgrade to PHP 4.4.7

--Chick Foxgrover

Shivian Balaris’s picture

I experienced the same situation, arg!!

marcbe’s picture

Well, from my tests, it looks like they are correct that it isn't a Bluehost problem. I had the same errors running on a local server running PHP5 so it must be caused by something else... I don't know what could cause these warnings.

Shivian Balaris’s picture

This problem happened to me, and I found out it was a problem with Textile not working on Dreamhost's latest PHP upgrade. So report it as a textile bug, or push the creators of the textile module to upgrade the module.

bkoen’s picture

I've had the same thing happen with 1&1. They have recently upgraded to PHP 4.4.7 and I started to get 500 errors, but only on one browser platform, Mac Firefox. Site worked ok on IE6 & 7, Safari, and PC Firefox.

I deleted the textile module and the problem cleared up.

my 2 cents...

Andrew Vit’s picture

I'm running a 4.7 site on Dreamhost under PHP 5.2.1 and ran into the same problem. Changing my page content not to use textile fixed it.

rizqi’s picture

i have hosting in dreamhost, and have the same problem with 500 internal server errors. Just searching around in drupal.org and i found this page http://drupal.org/node/110219 - Mysterious 403, 404, 406 or 500 errors depending on submitted content. I have turn off the mod_security setting in dreamhost panel. I hope this will work.

mdlueck’s picture

We are getting this at 1&1. We have the setting in .htaccess to run the site at PHP 5.21. No Textile module installed.

I just tried switching back to PHP 4.x (commenting the line in .htaccess) and it still had the error.

Also the suggestion to turn off mod_security via an .htaccess section had no affect on the problem for us.

Open to further suggestions...

Thanks,
Michael

mdlueck’s picture

I tracked our problem down to the .htaccess file. Specifically the line:

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

near the bottom of the file. Commenting that one line solved the 500 errors!!!

So, what was that line intended to do?

Thanks,
Michael

mdlueck’s picture

1&1's reply to this situation...

Unfortunetly this is beyond the level of support that 1and1 provides.
Drupal is a 3rd party program that you installed on your webspace, we
cannot give support for this product. If you changed your website over
to this and now it doesnt work properly is unfortunate but we cannot
give support for this product.

Glad I at least tracked it down to that rewrite rule.

jt6919’s picture

this absolutely doesn't work, it turns every single node into the frontpage.

jt6919’s picture

this absolutely doesn't work, it turns every single node into the frontpage.

mdlueck’s picture

Those commented lines in the .htaccess file have the affect of disabling clean URL's. So you will need to update your web site to get the links working again, then you should be all set.

With clean URL's turned on a link might be:
/admin/content

But with clean URL's turned off it would be:
/?q=admin/content

So, simply insert ?q= in the URL.

meerkat’s picture

Rewrite rules are a bit of a mystery to me, so if anyone could shed light on it...

roitee’s picture

Well am an amateur, had same problems while installing, 500 error, I simply deleted the .htacess file and all worked perfectly. I don't know if doing that is good or not, it worked, and thats all I care.

BryanSD’s picture

I'm seeing a lot of the same 500 errors. Anyone checked to see if their php.ini also includes eaccelerator? I'm not with Blue Host but just moved a site to a server at ResellerZoom. I have a theory that eAccelerator is not being compiled for the differing versions of PHP running on the server. Whatever is causing this it truly is annoying.

Bryan
CMSReport

mdlueck’s picture

1&1 has this to say about their PHP implementation:
http://faq.1and1.com/dedicated_servers/managed_server/5.html

Sounds like you can set your own php.ini file.

I checked phpinfo() and found no "eaccelerator" string anywhere in the output. Is that really how it shows up, or does phpinfo() even show it?

<><><><><><><>

I can not remember if I mentioned this on this thread...
Clean URL's turn 404's into 500's - Reporting the Solution
http://drupal.org/node/165761

aaahhh, I see that I did NOT mention this solution on this particular thread... rather just reported that I tracked it down to Clean URLs. So maybe give that a try, and if it "Works for Me" report it here or maybe in the bug report.

Thanks!
Michael

Anonymous’s picture

I've had the same problem with Bluehost and couple other Cpanel hosts, in the end the problem was in the .htaccess file:

# 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>

In the end I commented out the above codes in .htaccess and created a custom php.ini file with the following:

magic_quotes_gpc                0
register_globals                0
session.auto_start              0
mbstring.http_input             pass
mbstring.http_output            pass
mbstring.encoding_translation   0

Which solved the problem.

According to the support, apparently it's not a Drupal problem, since my server run PHP as CGI and therefore, it does not take the PHP modifications done through .htaccess, so creating a php.ini just for that site's folder solved it (putting the php.ini file inside that site's directory). Quoting the support: "the way that the default drupal configuration try to change the PHP environment, they try to do it through .htaccess when in this servers running php as cgi have to be done through php.ini".

However it seems this was only able to work because the host run PHP as CGI, and not as an Apache module.

Another thing is, my other sites running on Drupal and PHP5 seems to work fine, so I think there were some special configurations that is causing this error, I tested it with all my custom modules and themes, but still couldn't find the source :/

mdlueck’s picture

You seem to have stumbled against a rather interesting discovery!

Seems 1&1 also runs PHP as a CGI:
http://faq.1and1.com/scripting_languages_supported/php/14.html
(and I did check that it is running as CGI, checked with an installation of Gallery we have and it reports PHP as CGI)

Your PHP.INI values make sense - the entries from the PHP 5 section which is the PHP I have selected at 1&1.

However, according to the 1&1 FAQ, custom PHP.INI files take affect for the directory they are located in only. So what directories did you end up placing a PHP.INI file in? Only the web root / location of Drupal's index.php?

mdlueck’s picture

Please see this Gallery support entry:
http://gallery.menalto.com/node/68598

Complete success AT LONG LAST with 1&1!! WOO HOO!!!

Anonymous’s picture

Glad it worked :)

To answer your question, I placed the php.ini file in the directory where I installed Drupal, so yeah, basically where the index.php is.

jensimmons’s picture

I've been working on a new Drupal site hosted on 1and1 for about six months now. It was fine (half built, with clean URLs working) in April, when I left it for a month to go work on a theater/film project. I returned to the Drupal project in late May, and installed a bunch of modules, excited to get back to it — and started getting a stream of 500 Errors. I figured I had done something wrong / introduced a bug when I installed all the new modules. The errors weren't consistent. Some pages would always give a 500 error (like the main Admin page, and, conveniently, the module admin page); many pages would give an error sometimes and not others. VERY frustrating and confusing. And I couldn't get any work done on the site in the meanwhile. I deactivated the new modules via phpMyAdmin and erased them from the server... modified the database.... modified the .htaccess file.... still nothing worked. I could make the problem worse + get 500 Errors for every page, but nothing I tried made it better. I upgraded from Drupal 5.1 to 5.2, still 500 error 500 error. I tried all the suggestions on this thread, and from other threads... nothing. Head banging. Banging. Banging.

After a month of getting nowhere, I hired a server / php ninja to help. He was very frustrated that 1and1 would not provide access to their error logs so we could see what was happening. Their tech support was useless. And he had no clue about what was going on. So we moved the entire site, database and all, to a server at TextDrive. And it worked perfectly. I reinstalled all the modules I had installed before, and it still worked perfectly. It wasn't the modules. Apparently 1and1 upgraded PHP in late May, right before I returned to the project. Probably something about the changes at 1and1 caused the errors.

In any case, there's no point in trying to track down the conflict between 1and1 and Drupal. I simply told my client they have to cancel their hosting at 1and1, and we are moving to TextDrive/Joyent. Meanwhile I've gotten back to work developing the site. I've learned to be pickier about choosing a host, especially in picking one with good tech support.

Jen Simmons
The Web Ahead
http://jensimmons.com
http://thewebahead.net

mdlueck’s picture

Apparently 1and1 upgraded PHP in late May, right before I returned to the project. Probably something about the changes at 1and1 caused the errors.

Were you using 1&1's PHP 4.x offering or PHP 5.x offering?

1&1 FAQ about selecting PHP 5.x as default:
http://www.faq.1and1.com/scripting_languages_supported/php/9.html

We are having success with PHP 5.x, configured thusly. Linux Shared Hosting package, Business level.

jensimmons’s picture

Great tip! It made me hopeful... Our site was (presumably) running PHP4 by default, so I changed the htaccess file so it would run PHP5 instead -- and the 500 errors are still there. Meh.

The site is also running on shared hosting, business level, on a package bought in Marchish. I'm glad yours works! Ours still doesn't, so I still plan to move hosts. Debating joyent vs. mediatemple vs. others.

Jen Simmons
http://milkweedmediadesign.com
http://jensimmons.com

Jen Simmons
The Web Ahead
http://jensimmons.com
http://thewebahead.net

mdlueck’s picture

Do you have the copyright module installed? That is known to cause 500's.

Have you added the "RewriteBase /" I found that is needed in the .htaccess file? The lines in that file dealing with Clean URL's cause 500's on 1&1's servers without that line being added.

Those two immediately come to mind...

jensimmons’s picture

No copywright module,
yes RewriteBase/ -- that was one of the first things I tried

Jen Simmons
http://milkweedmediadesign.com
http://jensimmons.com

Jen Simmons
The Web Ahead
http://jensimmons.com
http://thewebahead.net

cameron32’s picture

I am moving two older 4.7.4 Drupal sites from one 1&1 server to two other 1&1 servers. For some reason, the destination servers kicked out 500s with the exact same .htaccess as the working source server. I tried your RewriteBase / fix and it solved the problem. You never know how many months later something will help somebody. Thanks!

Ragmop’s picture

When I ran update.php, I would get the error 500 - internal server error. I am hosting on 1and1. I tried so many fixes to settings.php, htaccess and creating a php.ini to no avail. The problem would always come back after some time.

I finally found a fix at http://gregorytucker.us/?p=46.

I added the line
AddType x-mapp-php5 .php
to my htaccess because it's 1and1 specific and IT WORKED. Now I am just hoping it stays working. No other fix had done so.

Hope this helps!

thebeacon’s picture

Here is the solution. You were probably BlueHost member when they still were running PHP 4. Now the most stable is PHP 5. You have to go to your cPanel panel and change your PHP 4 to PHP 5. Simple :) and more "500 Internal Server Error"

LL77’s picture

if you have the "500 Internal Server Error..." problem during the installation with STRATO in Germany, go to your STRATO Loginpage -> Homepagegestalltung -> Website Konfigurator -> PHP Konfiguration
If your Domains are in different folders (e.g. domain1.de in folder /domain1/) select the domain folder and make individual settings for this folder. Set "Verzeichnis-Browsing" to active and PHP Version to PHP 5.2.2 for the *.php and *.php5 files (other can stay unchanged). -> save

Now the istallation and the page should work...

flyingvisit’s picture

So, I also had issues on installing this, the 500 internal server error.
At first I deleted the .htaccess file, but obviously this then meant I couldn't have the clean URLs, which is one thing I really desired.

So, I checked my logs, and saw that a particular command was failing - "order is not allowed here." To fix this I commented out (placing a hash/pound symbol in front of the line).

#"\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
# Order allow,deny
#

Then, I tried again, still recieved the error. So I checked my logs again, and "Options not allowed here". This time I commented out

# Options -Indexes

and

# Options +FollowSymLinks

Tried again to access the page, and still received the error. Checked the logs again, and this time it was "Directory Index not allowed here"....

Eventually I commented out all the lines that my host disagreed with, which left the Rewrite lines intact, and means I can still have clean URLs.

I hope posting this method of fixing these issues will work for someone else too, as now I have it working, I'd like to pass the method I used to fix it to others who are having the same problem.

dzieyzone’s picture

+FollowSymLinks No longer supported by bluehost or most of the host servers, instead they use

Options +SymLinksIfOwnerMatch

payamspot’s picture

Had same problem on Drupal 7.15

Commented line 14 of .htaccess ("Options +FollowSymLinks") and problem solved!

I hope I encounter no problem in the future by doing this.

CyberSkull’s picture

This just happened to me 10 minutes ago. As it turns out, it looks like something on Bluehost's end obliterated their PHP settings. When I checked that CPanel module there were no option set. So I set PHP 5.4 and my site worked again. I then changed to 5.4 FastCGI and it still worked. I'm betting an updated zapped the config files.