Hello,
I have an intermittent repeating 500 status error appearing in my access log for two particular files. According to the hosting company nothing appears in the error log for them.
(see my previous thread at [
webmasterworld.com...]
The two files, from the outside, are css files, but they're actually php files.
The php seems to be working OK (that's not a 100% sure but things are pointing to the php being OK):
- the # of bytes transferred for the files, as reported by the access log, are correct when there's an error
- throughout the php code I've put database equivalents of echo()'s to see if things are Ok and even on error they are
Certainly the full php code is executing to the end seemingly correctly.
The two files are on a subdomain, their address from the outside:
subdomain.domain.com/css/file1.css
subdomain.domain.com/css/file2.css
and on the server their addresses are:
subdomain.domain.com/css/file1.css.php
subdomain.domain.com/css/file2.css.php
The full contents of
subdomain.domain.com/.htaccess
is
CookieTracking off
# stop auto index (which shows dir contents when there's no index.html/php file)
Options -Indexes
# caching -- start
Header unset ETag
FileETag None
Header unset Last-Modified
Header set Expires "Thu, 1 Jan 2030 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
# caching -- end
RewriteEngine On
RewriteRule ^([^.]+)\.css$ /$1.css.php [NC,L]
Then at the top of the two erroring css/php files:
header('Content-type: text/css');
(I did have SetOutputFilter DEFLATE in a .htaccess, thought that might be the source of the problem, removed it, still getting errors -- no compression is involved in this problem now)
The headers the two files have look like this:
HTTP/1.1 200 OK
Date: Sun, 06 Feb 2011 11:25:17 GMT
Server: Apache/2.2.9 (Debian) mod_fcgid/2.3.5 Phusion_Passenger/2.2.15
Content-Location: file1.css.php
Vary: negotiate
TCN: choice
Expires: Thu, 1 Jan 2030 00:00:00 GMT
Cache-Control: public, no-transform
Connection: close
Transfer-Encoding: chunked
Content-Type: text/css
I doubt it's related to the error but why is reporting the actual file name ("file1.css.php")? And why:
Vary: negotiate
TCN: choice
?
I've tried unsetting those in a .htaccess in subdomain.domain.com/css/ but the unsets didn't remove those headers.
I've noticed browsers, esecially MSIE 6,7,8, are ingoring the caching directives for the two files which are erroring. On visits to further pages (file1.css is used on multiple pages) the browser keeps asking for it on each page visit, but I have a whole load of images in
subdomain.domain.com/img/
and those are being cached fine. Just for the record, the headers of one of the image files are:
HTTP/1.1 200 OK
Date: Sun, 06 Feb 2011 11:32:01 GMT
Server: Apache/2.2.9 (Debian) mod_fcgid/2.3.5 Phusion_Passenger/2.2.15
Accept-Ranges: bytes
Content-Length: 303
Expires: Thu, 1 Jan 2030 00:00:00 GMT
Cache-Control: public, no-transform
Connection: close
Content-Type: image/png
Not sure why I'm going on about headers, I doubt, although am not sure, they'd be a source of the problem. But there is something odd about the two files which are erroring as hinted at by their headers. Plus there's some oddness to those two files so far as .htaccess files go. I did have SetOutputFilter DEFLATE in
subdomain.domain.com/css/.htaccess
and that compression wasn't kicking in. I tried the compression in
subdomain.domain.com/.htaccess
and it did work (again, just to be clear, now there is no compression at all). It's just odd that something in one .htaccess doesn't work, but in another does. Not sure if that's because of the rewrite or not.
Apart from finding the error, which is the main point of this question, I'd also like to get rid of certain this:
Content-Location: file1.css.php
but also probably
Vary: negotiate
TCN: choice
(I guess there's some connection between those three headers). How to? Why are they there?
And, any suggestions what the 500 error might be?
Thanks.
[edited by: jdMorgan at 9:46 pm (utc) on Feb 7, 2011]
[edit reason] Linked to previous thread [/edit]