Trying to find source of intermittent 500 error

for two particular similar php files on a subdomain, in the server access log, i’m seeing intermittently, rarely, 500 errors for those two files. i haven’t been able to witness it erroring myself.

one thing, which is what this question is about, is, the number of bytes transferred as reported by the access log, shows the correct amount whenever it errors. so say the correct amount of bytes is 12345, then when it errors, just after the status code 500, they’ll be 12345. does that indicate quite strongly that it is nothing to do with the php code itself? are there any scenarios where the correct number of bytes are transferred and it’s a problem in the php code being executed?

thanks.

Is nothing being written in the apache error log?

it’s a shared hosted server and i don’t have access to that log, but i’ve asked the hosting company, provided them with various entries in the access log – ones which had 500 errors – and they tell me no entries correspond to them, so apparently there’s nothing in the error log. does that fact indicate that it’s a php problem?

A google search of the issue says a few things like: busy shared hosting will cause this temporary or not enough memory available to php might also cause this. Other people indicate potential misconfiguration with PHP.

Perhaps if you post a link to the pages in question, it might help.

> A google search of the issue says a few things like: busy shared hosting will cause this temporary or not enough memory available to php might also cause this. Other people indicate potential misconfiguration with PHP.

500 is a catch all error – that’s how i understand it. php can cause it. .htaccess can cause it. server set up can cause it. probably other things.

> Perhaps if you post a link to the pages in question, it might help.

that won’t really help i don’t think. you’d either see the page working fine, or, maybe 1 time out of a 100 (although i personally haven’t been able to see the error myself), get a 500 error. neither would help i don’t think would it?

there’s a whole wide array of possible sources of problems. this question is trying to narrow it down a bit. i’m trying to work out if the source of the problem is php or not.

i’m wondering if anyone knows if the fact that the number of bytes reported in the access log as transferred, the fact that when it errors is the same as when it doesn’t error, indicates that it is not a php problem? my guess is, but it’s just a guess and am looking for confirmation, is, if the code went wrong 1/2 way through, say, it’d stop, thus giving a different number in the bytes transferred? this is based on my assumption that the number of bytes reported in access logs as transferred is exactly as it sounds – but i don’t really know much about that value.

host213-12… - - [29/Jan/2011:15:15:01 +0000] “GET /c/main-1.css HTTP/1.1” 500 23977 "http://www

23977 is the amount it is when it’s fine (200 status code rather than 500), and as you can see, the amount when it errors.

to me that indicates it’s probably not a php problem?

i guess there might be some ways that php could output the correct number of bytes (so let’s assume the right content) and yet still error maybe. not sure.

it seems very odd that the right number of bytes are apparently being transferred and yet it’s labelled an error. is that odd? seems it to me.

When I had my sites hosted with a company a few years ago, I did notice some 500 error codes and it was because of my traffic and some of the other hosted sites were too much for their severs to handle. Why the amount of the file would still show up in the log is weird, because if the file stopped loading it would differ than the actual size ( or so you would think ).