Browser wants to download PHP scripts instead of loading them

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • subhajit
    New Member
    • Jun 2007
    • 1

    Browser wants to download PHP scripts instead of loading them

    getting an error where instead of executing the PHP file as per normal, the browser sees the page as a file (therefore opens up a execute/save pop-up).
  • henryrhenryr
    New Member
    • Jun 2007
    • 103

    #2
    Sounds like you don't have php installed on your machine. Or it's not connected to the server. Or your php script isn't in your web-directory (eg htdocs). If you're using windows then directing your browser to a normal '.php' file outside your web server, the browser will treat it like a text file or a dowload.

    You would need to check the configuration of your webserver (eg use httpd.conf for apache) and make sure php is correctly installed. Test the php installation with <?php phpinfo(); ?> on it's own in a file on the web-directory root (eg c:/www/apache/htdocs/).

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as 'problem' actually get FEWER responses?).

      Heya, subhajit. Welcome to TSDN!

      Check out this thread.

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        Have you got the PHP tags in your PHP script
        Code:
        <?php  ?>
        If not, a browser treats the file as HTML

        Comment

        Working...