Forum Moderators: coopster

Message Too Old, No Replies

500 Server Error

         

grandpa

4:33 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Arrrrgh! I've been seeing this error message for the last hour for any php page on my site. A horrible sight.

Worse, there's not much I can do about it. Apparently someone at the hosting service spent the afternoon tinkering with the server / php settings. Not sure. All I get is "we are aware of the problem and we are working on it now".

Great! So all my ad campaigns are paused. No one can view my site. And I keep deleting the core dumps because apparently they accumulate towards my disk usage!

So, shall we speculate what was changed on the server to cause the problem?

digitalv

4:41 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using Internet Explorer? Often times in IE, the 500 error is really just hiding the "real" error and description.

If you're using IE, go to TOOLS then INTERNET OPTIONS and hit the ADVANCED tab. Scroll down until you find "Show Friendly HTTP Error Messages" and UNCHECK this box - then revisit the page you're having a problem with to see the real error.

grandpa

5:00 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



According to my error logs all of the scripts are ending prematurely.

[Mon Jun 20 21:57:00 2005] [error] [client xx.xx.#*$!.xx] Premature end of script headers: /home/domain/public_html/index.php
[Mon Jun 20 21:56:41 2005] [error] [client xx.xx.#*$!.xx] Premature end of script headers: /home/domain/public_html/index.php

digitalv

5:04 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try changing the permissions on one of your PHP pages to full read/write (777 I think) and see if you can view it then. Perhaps your host took away read permissions to your pages?

grandpa

5:12 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Dang! That didn't work. Got the same 500 Server Error.

I think about all I can do is whine and wait.

Burner

5:25 am on Jun 21, 2005 (gmt 0)

10+ Year Member



I don't know if it helps, but I ran into something like this once myself. I uploaded PHP scripts that did that to my server.

All the PHP code started with:
<?
PHP CODE HERE
?>

I changed all my PHP code to read:
<?php
PHP CODE HERE
?>

and the problem went away. Could it be the same thing happening to you here? I've also seen text saved in Windows/DOS format do that and running them through a "Save as Unix" text format type procedure will fix it immediately.

Burner

Burner

5:30 am on Jun 21, 2005 (gmt 0)

10+ Year Member



Actually, I notice you used *nix type paths in your post. If someone used Windows to edit your files, it's highly likely that they (the files) just need to be resaved in the Unix type format...

Burner

grandpa

6:00 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I uploaded PHP scripts that did that to my server.
.. me too. That's not the problem today. I'm not working, I'm packing for a well deserved vacation. Nothing was uploaded.

<?php

I'm pretty strict with that one.

<speculation>
Here's what happened. The sys admin jumped on a plane to New Orleans this afternoon, and his idiot helper screwed the pooch. You folks call the office when you get settled in. I'm told 'tomorrow' before service is restored. How long does it take to reboot a server?
</speculation>

Since the server is still serving html just fine, I altered my index.html page with a custom message and then pointed the 500 error to the index.
ErrorDocument 500 http://www.domain.com/index.html

Burner

6:07 am on Jun 21, 2005 (gmt 0)

10+ Year Member



I'm out of ideas... I'd really love it if you post what happened when you find out what happened in the next few days. Mostly to curb my curiosity, but also for those of us reading this that come across this condition again.

:~/ Burner

BTW... Enjoy your vacation!

grandpa

6:16 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'd be happy to send you the core dumps :)

I'm also curious as to what happened. A good guess is that someone was tinkering with Apache and not PHP, and didn't quite get it right. I learned a while back that's its useless to yell at the poor sap who has to answer the phones. I was able to determine that it's gone at least to level 2. Maybe the other sites on the server aren't reporting problems. But here's the real truth. I will never be told what caused the problem.

grandpa

7:05 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Right now I can access some of the php scripts in my admin panel. But they aren't running right.
Here's a sample. I have the following code in a script

foreach ($detarr as $value) {
...
$vwrf = wordwrap($value, 30, "\n", 1);
...
}

and its returning this error

Warning: wordwrap() expects parameter 1 to be string, array given in /home/blah/blah.php on line 298.
Interesting... what would cause that? Something in php.ini? Version is 4.3.11

The rest of the site has stopped returning a 500 error and now simply displays a blank page. <sigh>

grandpa

7:58 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I hope one our PHP gurus has managed to get this far into the thread. Here's what happened. My host runs two seperate instances of PHP, one for the client accounts and the other for the client panels. One installation of PHP was upgraded, the one that controls all of the panels. The other PHP installation was left untouched. But the user installation quit working, and on the server the admin is getting an error message and a HALT whenever a script is run.

In testing, a very simple 'hello world' script executes properly.

I don't know what version the upgrade was for, but I'm guessing it was V5.

Apparently, for the moment, the sys admin is stumped. Can anyone shed some light (perhaps with more information?)

coopster

10:32 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If scripts are executing, but certain functions aren't working then I would venture a guess that PHP isn't compiled correctly or compiled without needed extensions. Paths to extensions would be another red flag area. Also, make certain the server is finding and reading the php.ini configuration file. Wow, a real bummer ...

grandpa

11:16 am on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I finally got my site working, sort of. I appreciate you all allowing me to troubleshoot the problem here :) I use a class, phpSniff. It retrieves nice little bits of information, including the ip address, browser, os, etc. The class returns an array. For whatever reason the return values are not being processed, and the server halts, with a message on their side I'm told. I get no errors, the script just stops with a blank page.

To hasten this along, I've commented a line in one include and now my scripts run. There are a few problems associated with not having some of the info I was using, that blows!

Looking very closely at this what I've seen is that arrays are not being handled properly. See msg 11, and then this is what I've had to disable in an include that utilizes the class. I don't believe the problem is with the class, its looks like its with certain internal array processes.

function in_array_multi($needle, $haystack)
{
if(!is_array($haystack)) return $needle == $haystack;
foreach($haystack as $value) if(in_array_multi($needle, $value)) return true;
return false;
}

//$my_return = in_array_multi($my_test, $alluas);

grandpa

12:30 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If I could describe this problem properly there might still be something to be learned.

The boolean value of $my_return is the show stopper. (I believed I described it as an array return earlier.) By changing a single line in my script the return is handled properly.

the code
include ("checkbot.inc"); // returns $my_return as bool
if (!$my_return) {
include ("sessreg.inc");
}

modified code
include ("checkbot.inc");
if ($my_return == 'false') {
include ("sessreg.inc");
}

Of course, this still poses a big problem since those particualr lines reside in every script, and not an include. So for now all I can do is prevent the return value of checkbot from being set. More and more this looks like a php.ini setting. But, is it also something I should have prevented? .. looks that way ..

FWIW, to recap, this line of code did not cause the original 500 error condition. Some changes on the server by my host has caused this problem. Apparently they have now restored the system, but is looks like settings have been changed.

jatar_k

3:54 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well, I'll tell ya running 2 versions on the same box is not an easy thing to get right

what OS on the server itself? (I read the whole thread but didn't spend a ton of time so if you mentioned it, sorry)

do they maintain the seperate versions one cgi and one apache module or some other?

I am guessing wildly that a lib had to be upgraded and now they have nuked the old version because some shared/core lib is out of sync

grandpa

4:46 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your guess sounds as plausible as anything I have seen. I'm trying to go thru the php.ini settings, comparing them to my local setup. It's difficult because of the different versions. And I'm researching each of the settings that are different. But the further I go in this direction the less likely a simple config setting is causing the problem.

The only version I have any info on tells me the Server API is Apache. I haven't waded thru all of the configure commands that were used, and they are a bit harder to define than the core directive settings.

I have lost the ability to use phpMyAdmin, which I assume is controlled by the other installation of PHP. Here's an example of the errors:
Warning: Illegal offset type in /home/vdeck/public_html/phpMyAdmin/libraries/grab_globals.lib.php on line 74
The scripts do not have a problem reading from the db.

The one thing that might give me a clue is back in msg 14. When I uncomment the line for $my_return everything stops. The script simply will not run past that point, and there are no errors.

jatar_k

5:58 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



another thought is they just royally screwed up the install, yes, seems obvious but I wonder if it is a bad compile

grandpa

6:14 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



.. just royally screwed up the install

That became obvious when the first errors started showing up last night at 8:15pm. My problem with them right now is they think the screw up has been fixed. It's almost to the point of finding a new host today. I wonder how Murphy found out I was planning a vacation!

jatar_k

6:14 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> wonder how Murphy found out

hehe, he just knows ;)

grandpa

9:31 pm on Jun 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A few observations.

Last night the level 2 tech, who is suspect is really the systems operator, tried to assure me that PHP has been restored. However, the build date/time do not jive with that story. There was actually a minor version upgrade, and that happened following the initial problems. The level 2 support fellow suggested that PHP may have been installed as CGI and not as Apache. Not sure how that might affect things, but I'd guess it subtly affects how things work. As an aside, we lost our power last night as I was on the phone with the tech, and it was just restored in the last hour. So not only was my web site not working right, I couldn't do anything to try to fix the problems. So I lit a candle and waited.

I have one script that still refuses to work. Oddly, it is the only script I have placed in my cgi-bin folder. Anyway, it's been moved and works again.

digitalv. I appreciate your comments regarding IE. I did give it a try, but the pages wouldn't even load and error messages were non-existent (friendly or otherwise).

coopster and jatar_k, I passed along the suggestion that the build was possibly corrupted. But what system admin is going to listen to his customers?

This experience is just the sort of thing that concerned me when I first started PHP. Not so much the initial problems, that sort of thing is going to happen. More of a concern is that the operating parameters of PHP may get changed and scripts stop working. The boss was definitely giving me the evil eye, but he also understands that our site would have far fewer capabilities without PHP.

And, when I get back it looks like I'll have to rebuild by wiki forum, it's still completely hosed. All I can do for now is password protect the directory to keep people out. What a way to run a forum!

jatar_k

10:17 pm on Jun 22, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> may have been installed as CGI and not as Apache

that would make a big difference and could be the whole issue in a nutshell