LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-21-2004, 11:23 AM   #1
mdkelly
LQ Newbie
 
Registered: Jan 2003
Posts: 15

Rep: Reputation: 0
Apache2.0.52 + php4.39 +firefox downloading php rather than display


Hello all,

Very strange problem with an upgrade of Apache and PHP4 and the firefox browser.

Yesterday I upgraded apache and php and now I can no longer get the index.php to display in firefox automatically. I get the following
Code:
         You have chosen to open

          which is a: application/x-httpd-php
          from: xxxxxxxxxxx
          What should firefox do with this file?
If I type in my website address followed by /index.php it loads fine in firefox.
The page loads fine just by entering my DNS name in all other browsers I have tried, IE6, Netscape 7.2, Opera 7.x, and Mozilla 1.21

Before I upgraded apache and php the page loaded fine in firefox just by entering the DNS name. I am using exactly the same configuration file I was using yesterday before the upgrade and I have checked it over for any errors and cannot find any. I will post my httpd.conf file if it is necessary, but will wait until someone asks.

I have checked for all the normal php stuff in the conf file and as I said it was working fine before I upgraded so I really have no idea what the difference is.

I went from apache 2.0.47 to 2.0.52 and php 4.3.4 to 4.3.9

Everything with the website works fine except for this so I know that the two, apache and php, are functioning with each other.

Any insight greatly appreciated
Thanks
mdkelly

EDIT
Sorry should have included this.

If I do save the file to my hard drive, it comes up with some random name and no extension, and view it, it is my index.php file that has not been parsed.

I have a line
Code:
DirectoryIndex index.html index.html.var index.php
in my httpd.conf file so I am not sure why it is not automatically parsing and serving the page to firefox

Last edited by mdkelly; 10-21-2004 at 11:27 AM.
 
Old 10-24-2004, 05:13 PM   #2
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Rep: Reputation: 30
Did you say that php works if you type in index.php? Because I'm having a similiar problem except for php4 doesn't work at all.

Last edited by atheist; 10-24-2004 at 05:16 PM.
 
Old 10-25-2004, 10:29 AM   #3
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Rep: Reputation: 15
Yes, PHP works if I type index.php at the end of my DNS name. Actually it all works now, but I really am not sure why. I had previously been running my sites through apache and virtual hosts. I redid my previosly working http.conf and now it is working as it should. I still have no idea what was wrong or why it is working now, but it is.

Maybe if you post some more info about your problem I can give you a hand in fixing it.

mdkelly
 
Old 10-30-2004, 09:31 PM   #4
bzchi
LQ Newbie
 
Registered: Oct 2004
Posts: 1

Rep: Reputation: 0
Sorry if I am bringing this post up from the dead but it was amazing to find someone else having the same problem (from google search).

I am having this exact problem. All PHP is parsing except for a page that is requested using a mod-rewrite rule. This was all working 100% until an upgrade to Apache 1.3.33 about 2 days ago.

Everything works except for this page. Here is a copy of the .htaccess file.

-----------8<--------------
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/internalfile.php
RewriteRule .* /internalfile.php [last]

<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
</IfModule>
-----------8<--------------

What makes this even more bizzare is this problem only happens with Firefox. When I open the URL in IE it works 100% as expected. I am absolutely gobsmacked.

In Firefox, the file opens exactly as mdkelly069 describes

Code:
 You have chosen to open

          which is a: application/x-httpd-php
          from: xxxxxxxxxxx
          What should firefox do with this file?
When I open the random file name that firefox has given the file I can read the PHP source in plain text, it has not been parsed.

Has anyone got any futher information on this? I am at a loss as to why this happens? It has been working flawlessly for months, and the Apache/PHP upgrade didn't change any settings only upgraded Apache to 1.3.33 from the previously most recent stable release.

-EDIT UPDATE 1-

Some additional information I have found (which is also the same as mdkelly069 describes)

If I access using sub.domain.com/internalfile.php it works fine. If I access using just sub.domain.com Firefox tries to download the file.

This means that the virtual host is working for both because I am being pointed to the correct directory, but for some reason when I don't specify the .php extension in the URL the parser isn't invoked.

This doesn't happen on other sites (that use index.php). ie. www.othersite.com works, I don't need www.othersite.com/index.php

Because of this I attempted to add internalfile.php as a DirectoryIndex file in httpd.conf but this didn't help.

Continuing with my attempts to fix this


-EDIT UPDATE 2-
Just found something odd, if I access sub.domain.com/bla.php (doesn't exist) the page works 100% (because php is in the request URI). Even if I do sub.domain.com/php the page works 100% correct, the parser isn't working if PHP isn't mentioned.

Attempted adding DefaultType to the .htaccess but that didn't help. *more confused*

-EDIT UPDATE 3-
It actually works if you paste anything after the url. sub.domain.com/a works, so it isn't recognising the request if there is no specific file requested.

Last edited by bzchi; 10-30-2004 at 10:07 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox cant display php Xris718 Linux - General 3 11-01-2005 10:02 AM
Apache2 and php4 in Debian swmok Debian 1 06-09-2005 05:21 PM
apache2 + php4 atheist Linux - Software 6 10-25-2004 03:12 PM
php4 problem _ downloading index.php instead of displaying tharris Debian 2 10-24-2003 06:13 PM
Debian, apache2 and php4 Pasi Linux - Distributions 1 03-20-2003 07:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration