tags:

views:

89

answers:

5

Hi

All PHP pages are all running just fine on my site, except for one for which Firefox says "You have chosen to open checkpage.php which is a PHP script" and then wants me to select an application with which to open it.

The site is running PHP Version 5.2.10 on Centos 5.5.

I'm using exactly the same code on another site (PHP Version 5.2.10-2ubuntu6.4 on Ubuntu 9.10) and it's fine.

I've Googled myself silly trying to work out what the issue is!

Does anyone have any ideas why this one page might be causing a problem? The page is about 200 lines long but I'll post it here if it'll help...

All thoughts much appreciated Mike

+2  A: 

Last time I had this problem, I just installed PHP on my server. Worked fine after I rebooted it. Hope that helps.

Ultra_n00b
Thanks Ultra_n00b. One reinstallation later and it's fine.
Outerbridge Mike
A: 

Does the file that's downloaded have any content? Or is it zero bytes? It's possible something's causing PHP to puke on that script before it sends out any headers and so the browser has no choice but to interpret it as a download of a .php file with no content.

Check the server's error logs (and PHP's as well) to see if anything's showing up in there.

Marc B
Many thanks for your answer - the reinstallation of php fixed the problem.
Outerbridge Mike
A: 

Is there a separate htaccess in the folder that stops apache from sending it to php or changes the mime-type? Does the file have a different extension than other files on your site?

Michael Clerx
Many thanks for your answer - the reinstallation of php fixed the problem.
Outerbridge Mike
A: 

Use something like a packet sniffer, or HTTP Debugger, to see what headers are actually sent by the webserver. That will help you, and us, debug the issue.

eliego
Many thanks for your answer - the reinstallation of php fixed the problem.
Outerbridge Mike
A: 

Call curl -I http://blahblah/foo.php and look at the content-type header. That will help point you in the right direction. Is it text/html or something else?

Paul Schreiber
Many thanks for your answer - the reinstallation of php fixed the problem.
Outerbridge Mike