Apache is downloading php files instead of displaying them

后端 未结 26 1152
陌清茗
陌清茗 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:41

    When i upgraded from PHP 7.2 to PHP 7.4, i also got same issue. Worked by doing following:-

    1. In [domain].conf file, commented following:

      php_admin_value engine Off
      

      And Added:

      AddType  application/x-httpd-php-source  .phps
      AddType text/html .php
      
    2. Disable mod 7.2 and enable 7.4 by following:

      a2dismod php7.2
      a2enmod php7.4
      
    3. In /etc/apache2/mods-enabled/php7.4.conf file, comment following:

      SetHandler application/x-httpd-php
      php_admin_flag engine Off
      

提交回复
热议问题