Apache shows PHP code instead of executing it

前端 未结 26 1560
爱一瞬间的悲伤
爱一瞬间的悲伤 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:26

    I tried a number of the solutions above however the fix in our scenario was to install the fpm-module.

    We had installed httpd before php which may have had something to do with the issue, but to resolve we installed the following:

    yum module install php:7.2

    This installed the php-fpm-7.2.11-4.module+el8.1.0+5443+bc1aeb77.x86_64.rpm module which we then enabled by:

    systemctl enable --now php-fpm

    From that point we left the /etc/httpd/conf.d/php.conf as default and restarted httpd

    service httpd restart

    Then everything worked.

    Hope this helps, took way longer than it should have to figure out.

提交回复
热议问题