Apache shows PHP code instead of executing it

前端 未结 26 1583
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 02:23

I have recently been trying to install PHP and Apache on my computer. After many hours, they\'re installed. I have modified the httpd.conf and php.ini files like everyone sa

26条回答
  •  长情又很酷
    2020-11-22 03:03

    none of the above applied or worked for me... PHP7, Apache Httpd 2.2 on CentOS 6

    fact is, I installed (all with yum) php BEFORE Apache... you must do the reverse: always install Apache first, then PHP, and then it works... Indeed, you are likely missing libphp7.so and libphp7-zts.so in /etc/httpd/modules/

    I was able to recover anyhow without UNinstalling PHP. I did add the magic line in /etc/httpd/conf/httpd.conf: AddType application/x-httpd-php .php And then run: yum install php php-mysql

提交回复
热议问题