Page 1 of 1

Random Prompt to Download *.php pages

Posted: Mon May 11, 2009 10:36 am
by masterkeedu
I recently installed mediawiki on a Redhat server.

PHP Version 5.2.6
Browser Firefox


The issue appears to be related to Mime types. Every now and again ( on no particular page or URL) the user is prompted to download the page they are trying to view. Refreshing, or clicking the link again works fine.
:banghead:
The error is not easily repeatable. No corresponding entries in the apache error logs.

I have added the typical

Code: Select all

LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php php
DirectoryIndex index.html index.php
 
 
Lines to my apache config, this is the only site I am seeing this error on. (several sites are hosted on the box using the same version of PHP and Apache, but running on different instances of the webserver.

::EDIT::

I just got the error again and decided to view the file it is prompting with. The result appears to be the servers transmission including headers;

Code: Select all

HTTP/1.1 200 OK
Date: Mon, 11 May 2009 15:41:18 GMT
Server: Apache
X-Powered-By: PHP/5.2.6
Set-Cookie: wikidbUserID=deleted; expires=Sun, 11-May-2008 15:41:17 GMT; path=/; secure; httponly
Set-Cookie: wikidbToken=deleted; expires=Sun, 11-May-2008 15:41:17 GMT; path=/; secure; httponly
Set-Cookie: wikidbLoggedOut=20090511154118; expires=Tue, 12-May-2009 15:41:18 GMT; path=/; secure; httponly
Content-language: en
Vary: Accept-Encoding,Cookie
X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;string-contains=wikidbToken;string-contains=wikidbLoggedOut;string-contains=wikidb_session
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: private, must-revalidate, max-age=0
Content-Encoding: gzip
Content-Length: 3880
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8

Re: Random Prompt to Download *.php pages

Posted: Mon May 11, 2009 10:59 am
by codex-m
masterkeedu wrote:I recently installed mediawiki on a Redhat server.

PHP Version 5.2.6
Browser Firefox


The issue appears to be related to Mime types. Every now and again ( on no particular page or URL) the user is prompted to download the page they are trying to view. Refreshing, or clicking the link again works fine.
:banghead:
The error is not easily repeatable. No corresponding entries in the apache error logs.
What is the file extension where prompt to download occurs? Is it in .php or just any file type regardless of extension? Can you paste your header php , the one instructing the browser what to do with that file?

Example:

Code: Select all

 
header('Content-Type:audio/mpeg');
 

Re: Random Prompt to Download *.php pages

Posted: Mon May 11, 2009 10:23 pm
by Doug G
Are you using the new Firefox? I think there is a bug somewhere in FF3, I have seen the same symptoms (very rarely) both on local LAN server and remote php sites.