.PHP file opens as for download instead of interpreting to HTML

.PHP file opens as for download instead of interpreting to HTML

Post by m0sh » Tue, 08 Jan 2002 17:12:34



I've upgraded on Mandrake 8.1 to apache 1.3.22 and php 4.1.0 rpms.
Finally it worked but i can't open .php files normally, the browsers prompts
"Open/Save" box..

"AddType application/x-httpd-php .php" is in httpd.conf
tried with Action application/x-httpd-php "/usr/bin/php", even more weird
effect..

Maybe some LoadModule ?...

Please help..

 
 
 

.PHP file opens as for download instead of interpreting to HTML

Post by Hans van Nune » Wed, 09 Jan 2002 21:13:40



Quote:> I've upgraded on Mandrake 8.1 to apache 1.3.22 and php 4.1.0 rpms.
> Finally it worked but i can't open .php files normally, the browsers
prompts
> "Open/Save" box..

> "AddType application/x-httpd-php .php" is in httpd.conf
> tried with Action application/x-httpd-php "/usr/bin/php", even more weird
> effect..

> Maybe some LoadModule ?...

> Please help..

Hi,
Have you read the readme files that came with php?
It indeed is a LoadModule statement:
LoadModule php4_module        libexec/libphp4.sl
or something like that, depending where the libphp4.sl library is.
HvN

 
 
 

.PHP file opens as for download instead of interpreting to HTML

Post by Tod Glen » Thu, 10 Jan 2002 08:01:43




> I've upgraded on Mandrake 8.1 to apache 1.3.22 and php 4.1.0 rpms.
> Finally it worked but i can't open .php files normally, the browsers
> prompts
> "Open/Save" box..

> "AddType application/x-httpd-php .php" is in httpd.conf
> tried with Action application/x-httpd-php "/usr/bin/php", even more weird
> effect..

> Maybe some LoadModule ?...

> Please help..

Is there anything in your error log.  Something about a problem with
Libphp?  Is the php module compiled as static or are you using load mod

--
----
Tod Glenn

http://www.cordite.com

 
 
 

1. Apache trying to open excel file instead of downloading only

Hi,
  I've got a user having a problem with apache (1.3.9) under Unix
(Solaris7).  He has an excel document on his web site which he wants
users to be able to download.  However, when you click on the link it
tries to open the file in the web browser instead of downloading.  I'm
pulling my
hair out trying to determine why.   I have check the web browser
(Netscape 4.73) under both Unix and Windows and the same action
happens.  I do not believe it is a client problem as I can download an
excel file from a remote site.  I believe it is a server configuration
problem.  In the apache conf directory there is a file: mime.types.  In
it the following is listed for Excel:
  application/vnd.ms-excel
I have tried adding "xls" (without the quotes) on that line.  I have
tried adding entries to the httpd.conf along the lines of:
  AddHandler vnd.ms-excel .xls    (with and without the . in xls)
After each mod I restart the server.  But it still wants to try and open
the excel document in the browser.
Incidentally, the client application preferences are:
  Microsoft Excel Worksheet
  application/vnd.ms-excel
  xls
And the radio button is set to "Unknown, prompt user"

Can anyone suggest what I am doing wrong?
I have looked through the Apache FAQ and other docs but cannot see what
the problem is.  I must be missing something pretty obvious.

I've also tried running the server via "httpd -X" which the man pages
suggest is useful for debugging.  But got nothing useful.  I've also
trussed the binary but got nothing there either.

And if I rename the excel file to fred.doc (say) I get prompted to
download, as I assume it believes it's a M/S Word file.

--
Stephen Meatheringham
   Senior Network Engineer, IT Services Centre
   Australian Defence Force Academy

   Phone: +61 2 6268 8142     Fax: +61 2 6268 8150

2. ATI AGP card probs....

3. I see HTML tags instead of HTML pages

4. Here is one I would like to know (PPP and CHAT)

5. PHP: Evaluating a string as HTML with embeded PHP

6. IP masquerading and domain name registration

7. .htaccess directive to treat html file as php

8. TSpaces v2.0 Runs on Linux

9. Apache - using PHP in .html files

10. file.html and file.html/ give same thing

11. serving gzipped static html, download file bug with IE

12. Apache, CGI, PHP, open file descriptors, and Linux vs. BSDI

13. PHP not interpreted on AIX4.3