Topic: PHP not showing in Apache modules list

Hi all,

I've installed PHP 7.3* onto CentOS 8 from the REMI repo, following the instructions on the wizard page. If I create a test page with a phpinfo() it is served up by Apache and everything seems to work, with phpinfo() reporting that it is using PHP 7.3.20 from /etc/opt/remi. However...

The PHP application that I'm trying to install has some basic checks in its .htaccess, along the lines of:

<IfModule !mod_php7.c>
DirectoryIndex nophp.html
</IfModule>

The php7 module is not being found, and so Apache uses the nophp.html page. Also, according to apachectl -M, there is no sign of he PHP module loaded by Apache. So though PHP seems to be working, Apache doesn't know that the module is loaded and any check to see if it's there is failing.

Should the Remi PHP module be listed by apachectl -M? In which case, any idea what I'm doing wrong?

Is this the correct way of checking to see if PHP is enabled? This check has worked previously, so not sure if the check is wrong, or if there's an environmental problem.


* I'm aware PHP 7.3 is provided by CentOS, but it's missing some crucial modules that we need. We also need to switch to 7.4 soon anyway, as soon as our software supports it.

Thanks!

Re: PHP not showing in Apache modules list

Since EL-8, and on all modern distro, mod_php is deprecated and php-fpm is the default way to integrate PHP.

Was explained, for EL-7 on https://developers.redhat.com/blog/2017 … tion-tips/
And this is now the default for EL-8

> Should the Remi PHP module be listed by apachectl -M?

No

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: PHP not showing in Apache modules list

> Is this the correct way of checking to see if PHP is enabled?

If PHP is not enabled (FPM service not running), you will get a "503 Service Unavailable" error.

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: PHP not showing in Apache modules list

Okay, thanks, I'll have a read up on php-fpm then.