Ok. So latly my site has been going error 500 crazy. I get error 500's when I try to do a lot of admin featues. Like edit somthing in views or edit my modules. WHen I go to turn a module on or off, I get an instant error 500. THen when i hit back, the module is turned on or off like I wanted. I dont get. Anyone know what to do? I cant even edit some pages now without getting the
Error 500 - Internal server error
Thanks.
From #78:
[SOLVED]
My solution has been to change a parameter for APC in php.ini:
from
apc.shm_size 64M
to
apc.shm_size 512M
Restarting apache later everything is back to normal!
There is a a good article about APC Settings / Performance for Drupal:
https://groups.drupal.org/node/127609
Comments
Comment #1
bdragon commentedCould you get the exact error message(s) that are occurring? Check your webserver's error log (ask your provider for help if you do not know how to do this).
Comment #2
skallagrim commentedMine just started that too..
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: index.php
If you think this is a server error, please contact the webmaster.
Error 500
Comment #3
alexanderpas commentedare you, by chance, running on a host that uses php as a cgi module?
Comment #4
alexanderpas commentedComment #5
mojzis commentedI am having the same problem, and yes, the host has php as a cgi module :( Is there a remedy ?
Thanks
Comment #6
alexanderpas commentedcheck your file permissions!
this might also help: http://htmlfixit.com/cgi-tutes/tutorial_Common_Web_dev_error_messages_an...
please report back with more information
Comment #7
sunset_bill commentedI just started getting the same errors this morning--a full-page (not Drupal) 500 error on my browser and "Premature end of script headers" in my Apache error log. Uploaded a known working copy of index.php but errors didn't go away.
I'm not sure if my host (AN) is running PHP as a cgi, but that might be a clue. If they are, what is the fix?
salud,
Bill
Comment #8
sunset_bill commentedIn my case, it turned out to be a corrupted php.ini file on the server. Hope this helps someone else.
ciao,
Bill
Comment #9
ainigma32 commentedJudging from the age of this post I'm going to assume that this issue was resolved.
Feel free to reopen if you think that is wrong.
- Arie
Comment #10
HS commentedI'm faced with the same problem. I'm on Drupal 6.9 Anyone facing this issue on Dreamhost? OR shared Hosting? I wonder if that has anything to do with this...
Comment #11
HS commentedComment #12
ainigma32 commented@Hilalsuhaib: Have you look at the link on #6 http://drupal.org/node/213260#comment-1134332 ?
And if that didn't work, what kind of setup are you using (OS, database, PHP version etc.) ?
- Arie
Comment #13
ainigma32 commentedLooks like Hilalsuhaib won't be posting any feedback so I'm setting this to fixed.
Feel free to reopen if you think that is wrong.
- Arie
Comment #14
HS commentedIt is an issue with shared hosting on my end. Once the host resolved the issues with their server the problem disappeared. Sorry for not following up on this.
Comment #16
drupalphil commentedAlthough this is closed, I'd like to add a note for Dreamhost users in case they are struggling with "Premature end of script headers" (a server error found in user/logs/http.../error.og) and 'page not found' / internal_error.html (found in Drupal's log).
I moved a site from shared hosting to dreamhost_ps last weekend. The site worked fine for many things, but some users would get 'page not found' (internal_error.html in watchdog; 'premature end of script headers' in error.log) errors doing things on the site that I never had problems doing. For example, posting content or submitting a contact form was problematic.
I believe that it was those users with slower internet connections that were having the problem, but I couldn't prove that beyond an educated guess. I was able to eliminate these errors by doing the following:
1) created a custom php.ini following these directions
http://wiki.dreamhost.com/Custom_PHP.ini
2) edited the new php.ini to increase values for resources and change post_max_size :
max_execution_time = 1600 ; Maximum execution time of each script, in seconds
max_input_time = 1600 ; Maximum amount of time each script may spend parsing request data
memory_limit = 80M ; Maximum amount of memory a script may consume (8MB)
post_max_size = 80M
No more errors. I'm running with PHP5 as FastCGI.
Comment #17
aren cambre commented#16: thanks. I also just started getting those errors on Dreamhost and am trying those settings. Will report back if they don't work.
Comment #18
jcamfield commentedI just started getting this problem on DH today also, but only on one of my sites (all using similar settings, fastcgi, etc.) This did not fix anything for me. :(
Comment #19
aren cambre commentedIt was too good to be true. The fixes in #16 don't work on Dreamhost.
This also only recently started for me, too.
Comment #20
jcamfield commentedI have 3 sites on a PS and 3 personal site on shared; 2 of the PS sites are fine, 1 of the shared is working. On the PS, the largest site (most users and content) works ok for cached/anon usage, but logged in users get 500 errors, so I can't even log in as admin to up performance. On the shared hosting sites, there is no correlation between amount of users/content and the headers.
Things I've tried with no luck:
Emptying the access_log table
running cron via /cron.php (cron failed)
running cron via drush (cron success, no improvement
Clearing a large watchdog table via drush (cleared, but no improvement)
Clearing cache (cleared, anon users could still see the site but slower)
Restoring to a recent db backup (restored successfully, no improvement)
Things that kinda worked:
Restoring a week-old backup (could occasionally access site while logged in, but while I'm operating under the assumption that this is a DH issue that we'll eventually figure out, don't want to lose a week's worth of work)
Disabling admin_menu via drush to reduce the query load for admin page rendering - got me in, slow and occasional 500s still, but hey, progress!
I suspect that there is some problem around mysql responsiveness (affected but not only caused by the DH internal network problems), php execution timeouts related to mysql, and burdensome queries caused by non-cached blocks + views + panels + logged-in-user queries
DRUSH on DreamHost notes:
edit the drush script wrapper , change the last lines to:
run drush with -u 1 (force it to use the admin account)
Comment #21
aren cambre commentedReverting title. Per #20, admin_menu is not definitively the culprit.
Comment #22
toddgee commentedalso having errors as described on this thread from comment #17 onward. I'm suspecting DreamHost did something to their PHP configuration. I'm on a PS as well.
Am getting 500 errors any time I try to do things like:
post admin screens (views, modules)
flush cache with admin_menu
I'm going to submit a ticket and point them here. I don't know about y'all but I've had such troubles w/ DreamHost -- our PS requires rebooting quite often. I really like their administration control panel; but sheesh....
Comment #23
toddgee commentedDreamhost is reporting that some things are wonky right now:
http://www.dreamhoststatus.com/
My sites are loading, just not working correctly. It's weird -- something work correctly, but some things just don't (like submitting changes to the modules screen). It's hard to see how network issues could be causing this; but ???
Comment #24
aren cambre commentedtoddgee: my problems started a while back, I think roughly in the past 2 weeks?
Comment #25
dillonm commented@toddgee: I'm on dreamhost and noticed some issues as well. However, I'm in the same boat as you -- some things work while some other things don't work. Right now: logging in does not work, but anonymous users are fine.
I also tried #16 and it did not work - maybe I'll do it again when dreamhost gets things back up?
Anyone else experiencing this on dreamhost?
Comment #26
dillonm commentedadding tags
dreamhost, error 500, premature end of script
Comment #27
ppmax commentedMan--im totally locked out from logging in: 500's all day. Sent a few support requests to dreamhost but no dice so far.
I have MySQL Administrator up logged in to my user account and the connection health and memory health graphs are pegged....
The only good thing that's come out of this is I reworked a few views (with templates) that were sending crazy amounts of queries (my bad on that one).
Comment #28
ppmax commentedJust wanted to add that I've had some success by going to the dreamhost panel and changing PHP Mode from PHP 5 FASTCGI to PHP 5 CGI....
Comment #29
dillonm commented@ppmax I've had success switching to CGI (rather than FastCGI or mod_php). This should be a temporary fix until dreamhost can figure this one out.
Comment #30
dillonm commentedChanging to CGI is under the Dreamhost panel that's under Manage Domains / Domains / Edit (on your appropriate domain/subdomain).
Comment #31
ghiley commentedSame issues here. Occasionally pages load, sometimes 500 errors, sometimes page not found and timeout.
Dreamhost on shared hosting running Drupal with a media blog and approx 2000 posts (with photos).
SQL database queries are taking a crazy amount of time assume is part of the problem. Dreamhost has told me my scripts are being terminated due to a out of memory.
Definately know that the issues relates to pages with heavy content such as some admin pages or simply home page / main post pages. No problems loading Terms & Conditions for example.
Comment #32
dillonm commented@ghiley Switching to PHP5 CGI seems to do the trick.
Posting discussion from dreamhoststatus.com:
http://www.dreamhoststatus.com/2009/11/14/private-server-moves-causing-d...
Comment #33
ghiley commentedConfirmed the switch to PHP5 CGI has resolved the issue (and seems to speed the site up generally). Thanks @dillonm et al. (Great weekend for go-live... sheeesh).
Comment #34
asodder commentedThis is why I like Drupal - the support from all you guys... THANKS!
Before reading the PHP 5 FASTCGI to PHP 5 CGI trick I was painstakingly (and foolishly) following the advice that DH gave me in response to my ticket, which was that "the software running on it is using to much memory and our process watcher is killing your processes" and so I was trying to disable modules which obviously did not help.
Thank You
Comment #35
HS commented"the software running on it is using to much memory and our process watcher is killing your processes"
The above is the same BS response EVERYONE gets from them. I've got it sooo many times from their agents.
Comment #36
dillonm commentedStill having FastCGI issues as of this morning ...
Comment #37
joanpc commentedI have similar problems with FastCGI and CGI :( I'm unable to load the devel module to check MYSQL delays.
Comment #38
dillonm commented@joanpc Yep, me too, now both are completely down.
Comment #39
HS commentedMy sites on Dreamhost have been slow for over 24 hours. Over 30 seconds to load a page. Dreamhost PS seems like a scam. You guys are having the same issues as shared hosting.
Comment #40
aren cambre commentedReverting version to latest. If you're not on the latest, time to upgrade.
Comment #41
dillonm commentedI’m up and running fine now in FastCGI and CGI … anyone else?
Comment #42
joanpc commentedWorks better but still slow
Comment #43
aren cambre commentedThis morning I am getting nothing but database connectivity errors from Drupal or Premature end of script headers: index.php in my error.log.
My PHP stuff is hosted on hulk.dreamhost.com, and my MySQL is muckle.hazelnut.dreamhost.com.
Comment #44
ppmax commentedStill slow as molasses and lots of 404's and 500's. Switched to and from PHP5 FASTCGI & PHP5 CGI with no real difference. I've contacted DH support multiple times and have been told that "resource usage" is to blame. No sh*t. Most replies have advised that I consult the wiki for help finding causes of heavy usage--which I've done. This site ran fine 3 days ago. One reply was interesting:
"Also, please be aware that just because this site is the one getting killed, it isn't necessarily the problematic one."
It's got me wondering if they've combined a bunch of mysql instances...?
Comment #45
aren cambre commented@ppmax: something has definitely changed in the past few weeks. I use to get pretty snappy phpMyAdmin performance, but it is dog slow lately.
I left 1and1.com because of its slowness. Was initially impressed with Dreamhost's speeds. Now it's in the tank.
Comment #46
aren cambre commentedGood news: Dreamhost has tacitly acknowledged major problems. Just got this update on an issue I've been messing with for a few days:
Today I am getting the "Premature end of script headers" errors on many admin pages across all my Drupal sites. Strangely, my WordPress site works fine.
Comment #47
dillonm commentedI thought I was fine until just now, now I’m seeing erratic on/off 500 errors. Suggestions on other hosts? HotDrupal?
Comment #48
toddgee commentedI (author of posts 22, 23) tried switch from 'PHP 5 FastCGI' to 'PHP 5 CGI' on my DreamHost PS. I am still seeing the same 500 errors as I did (except the httpd error log says the error is with 'php5.cgi' rather than 'index.php').
Also on day 3 of being down.
Comment #49
aren cambre commentedI'm going to mark this as fixed. Looks like Dreamhost had a problem with its core router that affected a lot of sites. Per http://www.dreamhoststatus.com/2009/11/16/downtime-across-various-homie-..., it appears to be fixed.
Comment #50
siharris commentedSwitching back to active. Dreamhost can say what they like, I'm still getting the same errors, worse today than yesterday.
Comment #51
ppmax commentedIs anyone running 6.13 on DH with PHP5 FASTCGI? Are you getting 500's?
This is driving me nuts. I cant figure out if this is DH or drupal causing these things. All I know is that my site ran great a few days ago then BOOM: page load times (with cache) of over 1.5 minutes, 500's, and lots of 404's for pages/views that I know exist...
Comment #52
toddgee commentedIt's still not fixed for me either and I tried both the 'PHP 5 FastCGI' to 'PHP 5 CGI'
Comment #53
HS commentedGot the following today from Dreamhost after several trouble tickets.
Comment #54
toddgee commentedWell as of last night, my sites are working fine. I'm on ps13650. haven't received follow up from DH about all my tickets; but I guess they're busy.
Comment #55
aren cambre commentedDreamhost has something called procwatch that kills PHP5 processes if they detect too much CPU or memory use. This happens on a per-process or per-user basis. So yes, that in fact could mean low tolerance for the Slashdot effect or Dugg sites despite Dreamhost's marketing materials.
Drupal is inefficient, so this could be a factor for some, especially in sites with a lot of modules.
Comment #56
joanpc commentedI installed boost in order to serve all the pages cached from the HD. Now the site runs like a real dream, only for anonymous users but for my "static" site is ok. I'm learning a little about nginx to migrate to an unmanaged VPS service in a near future.
Comment #57
toddgee commentedI think it's safe to close this now.
Comment #58
jerdiggity commentedRe-opening...
This is driving me nuts. Here's my "deal":
- 500's almost 100% of the time (when logged in)
- If it's not a 500, it's a 404
- Running a multisite install w/ custom php.ini (FastCGI)
Any special perms? Settings? Modules (besides admin menu) that may be causing this?
Comment #59
jerdiggity commentedMoving this issue per "stale content" to #735048: "Error 500: Premature end of script headers" on admin pages
Comment #60
aren cambre commentedWhile this is closed, just wanted to report I have begun getting these errors again on Dreamhost's Hulk machine.
Comment #61
aren cambre commented...and Dreamhost confirmed it's because their procwatch daemon is terminating my processes due to excessive memory use. Yet they won't tell me how much is too much due to "security" reasons. Thanks, Dreamhost!
Comment #62
jbergeron commentedI'm having this issue now. Let's see what their support tells me.
Comment #63
jerdiggity commentedHey everyone.
FYI (in case you didn't see the other post @ #735048: "Error 500: Premature end of script headers" on admin pages) (and/or in case you care) I started a forum thread on this whole "dilemma" here:
http://drupal.org/node/862146
I'd be curious to hear what you find out @jbergeron...
Comment #64
HS commentedDitched DreamHost. I do not recommend this host to anyone who wants to run a Drupal site.
Comment #65
bdornbush commentedI have experienced this problem with Dreamhost, especially since I migrated my largest site from D5 to D6.
What hosting company did you change to? I am looking to also ditch DreamHost, but want a better host, not just a different host. Hosts I have used and am considering include Site5 and Hostmonster.
Comment #66
HS commentedGive 1&1 a look. Holding up pretty good so far.
Comment #67
aren cambre commentedI migrated off 1&1 18 months ago because of extreme slowness, inexplicable email forwarding outages, and totally opaque outage notification. Has this changed?
Comment #68
HS commentedProbably the server you were on. I'm not facing the same issues. Who are you with?
Comment #69
trungonly commentedI having same problem (Dreamhost, FastCGI, Drupal6x)
watchdog log: internal_error.html
raw error logs: Premature end of script headers: index.php
Note that in FastCGI, changing php_value in .htaccess does not affect.
Let's look in my .htaccess:
php_value memory_limit 128M
php_value max_execution_time 180
php_value max_input_time 180
php_value post_max_size 80M
But in phpinfo() in same directory, these settings are still in default & unchanged:
memory_limit 90M
max_input_time 60
...
Comment #70
aren cambre commented@trungonly: Are you hosting several Drupal sites under one account? There's a good theory at http://drupal.org/node/862146 that you'll hit more problems with the more sites you host under one account.
Comment #71
darrellduane commentedI have switched to a clean Fedora 13 install on linhost due to having this problem with a VPS from Dreamhost. On Dreamhost, I over rode the php.ini settings using the instructions from their wiki and the site worked fine until I had an processor intensive user import which lead to this error.
Comment #72
ptoly commentedI've had four Drupal accounts on Dreamhost stop working in the last 5 months. Either memory errors or Gateway time-outs. I've been trying, in vain, to get Dreamhost to look into their MySQL setup, which I suspect is the culprit. These sites are all on separate shared hosting accounts, one on a basic Dreamhost VPS.
I don't think DH offers any less memory than other shared hosting setups and the Gateway time-outs are not memory problems. Until previous to five months ago I didn't have any problems with Drupal on DH, certainly not of the magnitude I've been having recently. I can't run update.php or cron.php on many of these sites.
The upshot is, that after 9 years with DH, I'm probably going to have to recommend anyone who wants cheap shared hosting and a Drupal setup (2 of the sites that I've had problems are really basic) stay away from Dreamhost until they've improved/debugged their setup, and I'll be leaving for better support myself.
Comment #73
aren cambre commentedSolution: http://drupal.org/node/862146#comment-3597008
Comment #74
yasheshb commentedwe had similar error messages on beyondhosting
and fixed by changing the permissions of index.php from
Comment #75
1kenthomas commentedTo add to the grab bag: also seen with APC in combo with fcgid under Ubuntu 11-- increasing APC size above the default 30M caused more and more of these on D7 sites on a 2G server; disabling APC eliminated.
Comment #76
HS commentedI'm told that this is a memory issue and perhaps not related to one single host at all. If you're on shared hosting and have many modules installed, you're going to run out of memory. Even if you increase PHP memory, Apache (the server) also has a limit.
Create a text file called checkmem.php and put the following in it, and upload it to your server and run the file. You'll see that even if you increase your PHP memory, you'll exhaust your memory at a much lower level due to Apache restrictions.
Comment #77
cweagansSupport requests are never major or critical.
Comment #78
geberele commented[SOLVED]
My solution has been to change a parameter for APC in php.ini:
from
apc.shm_size 64M
to
apc.shm_size 512M
Restarting apache later everything is back to normal!
There is a a good article about APC Settings / Performance for Drupal:
https://groups.drupal.org/node/127609
Comment #79
thedavidmeister commentedComment #81
avpaderno