Site not displaying but rather downloading

前端 未结 4 797
被撕碎了的回忆
被撕碎了的回忆 2021-01-23 08:14

I am working on a site and just published it to the client\'s domain, but when I try to access the root or subpages, they download to my computer rather than displaying as the p

相关标签:
4条回答
  • 2021-01-23 08:20

    The PHP may be not installed, or incorrectly configured. Usually (if the client really installed PHP) it's caused by forgetting to set the file extension (.php / .phps / .php3 / .php4 ... ) to PHP handler.

    Check if PHP is running and if your output content type is correct.

    0 讨论(0)
  • 2021-01-23 08:24

    Your webserver does not know that these files should be given to PHP for processing -- for whatever reason, of which there are many. More info on the config is necessary.

    0 讨论(0)
  • 2021-01-23 08:25

    The server is not serving the php pages as a 'text/html' or 'text/xhtml' MIME type. Like what the rest said, PHP might not be installed or not configured properly.

    A quick way (not 100% though) to check if PHP is installed is to check the HTTP response header. Using Firebug's NET Tab on Firefox, you can look out for any 'server' value in the response header. Typically PHP version (if installed) will be included together with the web server type/version.

    E.g. Apache/2.2.13 (Unix) mod_ssl/2.2.13 PHP/5.2.9

    0 讨论(0)
  • 2021-01-23 08:41

    yes, you should ask your client to make sure php is installed.

    If it is installed and you are using apache.

    make sure your httpd.conf has something like this.

    AddModule mod_php5.c
    <IfModule mod_php5.c>
        DirectoryIndex index.php index.html
    </IfModule>
    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
    </IfModule>
    

    you may ask your client to visit here for proper php configuration for different OS.

    0 讨论(0)
提交回复
热议问题