SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy IE trying to download all PHP files?

    I left my website alone for a while, and have come back every so often in my browser of choice (Firefox) to make sure everything looks OK. I just got a call from a friend who said my entire site is down. He's using IE. So I fired up IE and sure enough, IE is prompting a download for every PHP page I've tried accessing. Here is the message of the prompt:
    Code:
    Internet Explorer
    
    File Download
    ======================================
    Do you want to open or save this file?
    
    Name: file.php
    Type: Unknown File Type, 8.55 KB
    From: www.mysite.com
    
    OPEN | SAVE | CANCEL
    
    [x] Always ask before opening this type of file
    ==============================================
    
    While files from the Internet can be useful, some files can 
    potentially harm your computer.  If you do not trust the source, 
    do not open or save this file.  What's the risk?
    I don't even know where to begin troubleshooting this. If you have any advice, please let me know! Thank you in advance.

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2004
    Location
    Boston
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, that usually happens when the server isn't running PHP.

  3. #3
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is usually down to a missing/bad AddType handler for php files.
    Check Apache's httpd.conf file for a lines like:

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    Also make sure there's a line like:

    LoadModule php5_module /usr/lib/apache/1.3/libphp5.so

  4. #4
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Crap. Safari is showing the same behavior. It is trying to download all PHP files just like IE Win. Things work normally in Firefox, Opera, iCab, Mac IE 5 so far.

  5. #5
    SitePoint Addict mmanders's Avatar
    Join Date
    Jul 2006
    Location
    Edinburgh, Scotland
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you host this site from your own PC or a dedicated server, I would check that Apache (httpd.conf) is setup to pass execution of PHP files to PHP. If this site is on shared hosting or hosted by a company rather than yourself it sounds like they are experiencing problems with their server. I'd get in touch and find out what is happening to cause this loss of service.

  6. #6
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help. It is not my own server, and I don't have access to the httpd.conf. I have contacted the company and they are "looking into it." It seems really strange that this would only effect certain browsers...

  7. #7
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    post the http response headers of a problematic page.

    you can use this tool(use the tool in IE)
    http://web-sniffer.net/
    or you can use the http live headers extension for firefox to view the headers.

    what is the contents of the file that it downloads? is it the html output, or the php source code?

  8. #8
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    Thank you for all of the help. The issue was indeed with the server and is now resolved. I didn't have a chance to view the headers before it was fxed. I would've liked to check that in order to hopefully help any forum readersa in the future that may have this problem. The problem was in the php.ini file (on the server's config, not one of my own)

    There was a value of:
    Code:
    default_mimetype = texthtml
    that needed changing to:
    Code:
    default_mimetype = "text/html"
    I hope this helps someone down the road. Thanks again all.

  9. #9
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes object buffering and/or gz_compression can cause this.
    Do you use compression on your pages?

  10. #10
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    none that I'm aware of unless the server automatically is doing it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •