Apache is downloading php files instead of displaying them

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

    I came across this issue today and none of the solutions described worked for me. So here is another possible cause:

    If you have something like

    AddHandler x-mapp-php6 .php3 .php4 .php .phtml
    

    in a .htaccess file of your web content folder, it can cause your PHP scripts to stop working. In my case the server did not know the x-mapp-php6 type, since that .htaccess file was something I imported from a different web host when I transferred the website content.

    Just removing the AddHandler line from the .htaccess file solved it for me.

提交回复
热议问题