0

On my rhel 7.2 system, I finished installing Apache 2.4.46 and PHP 7.4.19. However, when I start apache and access to my own php file, it shows source code instead of executing it. I find some solution on the Internet and try some changes in httpd.conf file such as adding this:

<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

and

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

unfortunately, it doesn't work. I realized that it does not have file "php.conf" in folder /etc/httpd/conf.d or file libphp7 in any folder.

So, how can I address this problem. Hope you guys would help me. Thank in advanced!!!

2
  • Did you enable the PHP module and restart apache afterwards? Is there an error in the logs? Commented Jun 30, 2021 at 10:16
  • After checking my php module in apache, I found out that there were any module file in apache. Thanks a lot, bro! Commented Jul 1, 2021 at 3:03

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.