Forum Moderators: phranque

Message Too Old, No Replies

500 internal error/log says 404

500 internal error after update

         

GGaryG

9:32 pm on Jan 17, 2015 (gmt 0)

10+ Year Member



I've been running my website for years and now yesterday I update 2 files, the same way I always do, and when I try to load them in a browser I get

Internal Server Error

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

The log says this:

[my ip] - - [17/Jan/2015:00:07:55 -0500] "GET /site/index.php HTTP/1.1" 404 - "-" [my agent string]

Permissions are 644, same as for the other files. I haven't encountered anything like this before and am totally stumped. Can anyone help?

aakk9999

10:40 pm on Jan 17, 2015 (gmt 0)

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



Have you tried reverting back to old version? What happens then, does the error go away or you get the same with the old version too?

If the error goes away, could you put changes back in little by little to figure out what may be causing it?

penders

11:03 pm on Jan 17, 2015 (gmt 0)

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



...I update 2 files


Not .htaccess by chance?

Has anything been updated on the server?

mod_security kicking in?

lucy24

11:08 pm on Jan 17, 2015 (gmt 0)

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



If you've got the raw access logs, you've probably also got the error logs. See if they provide more information. They'll definitely say if mod_security (assuming your site uses it, since it's third-party) is involved. Error logs will also show infinite loops from internal rewriting.

Do you get the same browser text in all browsers? Yes, it's a server error, but we also need to make sure there's no caching involved.

Incidentally ...

The log says this:

[my ip] - - [17/Jan/2015:00:07:55 -0500] "GET /site/index.php HTTP/1.1" 404 - "-" [my agent string]

If you're quoting from access logs, that would be the original request. Is that also the final URL of the page, or was it supposed to get redirected to /site/ alone?

GGaryG

12:24 am on Jan 18, 2015 (gmt 0)

10+ Year Member



I've tried reverting back to the old version. I've also tried using an empty file. No change in either case. Both files modified were php files, not .htaccess. Nothing else has been changed on the server (other than the regular update processes, which do not modify this particular folder at all).

Same browser text in FF, IE and Chrome. I found the error logs, here's what it says:

SoftException in Application.cpp:357: UID of script "/home/[user]/public_html/site/index.php" is smaller than min_uid
Premature end of script headers: index.php

I don't know what this means.

GGaryG

12:43 am on Jan 18, 2015 (gmt 0)

10+ Year Member



OK, I googled that error and changed the owner/group to the user instead of root and it all works. I dismissed this as a cause early on since basically every other file on the server is owned by root as well, but it looks like this issue only affects PHP files. Am I right in about this or could other files also trigger this issue? Anyway, thanks very much for your help - it has been a very stressful day for me!

lucy24

2:39 am on Jan 18, 2015 (gmt 0)

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



but it looks like this issue only affects PHP files. Am I right in about this or could other files also trigger this issue?

That depends on what's in the script, and what happens behind the scenes on your site. Just because something starts as a .php error doesn't mean its effects are limited to files with .php extension. It might also affect .html files, or even (rarely) images and stylesheets that call the offending script.

If in doubt, you might step next door to the php subforum where the experts hang out.

phranque

2:53 am on Jan 18, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, GGaryG!


it is common to assign low UIDs (<100) to privileged users.

this threshold (min_uid) is typically specified in the Configuration of suPHP:
http://www.suphp.org/DocumentationView.html?file=CONFIG [suphp.org]

GGaryG

10:23 pm on Jan 18, 2015 (gmt 0)

10+ Year Member



I wasn't aware of suPHP, but I've done a bit of reading and it all seems logical. I'm beginning to think I've been lucky to have the site run for so long with no problems until now :)