Apache is downloading php files instead of displaying them

后端 未结 26 1106
陌清茗
陌清茗 2020-11-22 01:03

OS and server information:

  • CentOS 6.4 (Final)
  • Apache 2.2.15
  • PHP 5.5.1

I previously had php 5.3.x installed but decided to upgr

26条回答
  •  无人共我
    2020-11-22 01:47

    The correct AddType for php is application/x-httpd-php

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

    Also make sure your php module is loaded

    LoadModule php5_module        modules/mod_php55.so
    

    When you're configuring apache then try to view the page from another browser - I've had days when chrome stubbornly caches the result and it keeps downloading the source code while in another browser it's just fine.

提交回复
热议问题