Cannot access php file in Apache 2.4 Centos 6

A 5 star hangout for overworked and underpaid system admins.
Post Reply
Posts: 1
Joined: 2022/04/05 07:14:15

Cannot access php file in Apache 2.4 Centos 6

Post by krunker » 2022/04/05 07:30:19

I have a server running Centos 6. I recently upgraded PHP to 7.2 from the remi repo and Apache to 2.4 via the sclo (httpd24).

Code: Select all

[user@server1 ~]$ httpd -v
Server version: Apache/2.4.34 (Red Hat)
Server built:   May 28 2020 08:47:33

[user@server1 ~]$ php -v
PHP 7.2.33 (cli) (built: Aug  4 2020 10:02:54) ( NTS )
My issue is if i put an phpinfo() in /var/www/html, my browser didn't show anything, and if i open the source i only see the php code.

How can I link the apache and php servers? Thanks.

User avatar
Site Admin
Posts: 32772
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot access php file in Apache 2.4 Centos 6

Post by TrevorH » 2022/04/05 10:01:31

You really don't want to run CentOS 6 at all. It went EOL in Nov 2020 and has more than 18 months of accumulated security vullnerabilities that will never be fixed. At least one of those allows any local user to gain root privileges with trivial effort adn that sort of thing could be converted into a remote attack if your other software stack has holes in it too. In addition, php 7.2 is also EOL.

Rather than re-arranging the deck chairs on the Titanic, perhaps you should look at moving to something that is supported instead.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

Post Reply