Score:0

Cannot find php module of apache

pl flag

I am running Apache 2.4.52 on Linux CentOS 7 server. I have installed PHP 8.

Followed many blogs to configure Apache to run PHP 8. Now I am at a point where visiting server IP address loads the index.php file but as a plain text instead od executing the script.

As I read, to overcome this, I need to load php module in httpd.conf file. I found the follwoing command

LoadModule php_module "/usr/lib/apache2/modules/libphp8.0.so"

I cannot find libphp8.0.so on my server as I think above command is not for centOS 7. If so then which php module file I should load and what will be the location of the module on my server?

Following another blog, I run the below command to install additional php modules

yum search php-

But this didn't help.

UPDATE

List of installed php packages

php80.x86_64                       1.0-3.el7.remi                    @remi-safe 
php80-php-bcmath.x86_64            8.0.15-1.el7.remi                 @remi-safe 
php80-php-cli.x86_64               8.0.15-1.el7.remi                 @remi-safe 
php80-php-common.x86_64            8.0.15-1.el7.remi                 @remi-safe 
php80-php-devel.x86_64             8.0.15-1.el7.remi                 @remi-safe 
php80-php-fpm.x86_64               8.0.15-1.el7.remi                 @remi-safe 
php80-php-gd.x86_64                8.0.15-1.el7.remi                 @remi-safe 
php80-php-mbstring.x86_64          8.0.15-1.el7.remi                 @remi-safe 
php80-php-mysqlnd.x86_64           8.0.15-1.el7.remi                 @remi-safe 
php80-php-pdo.x86_64               8.0.15-1.el7.remi                 @remi-safe 
php80-php-pear.noarch              1:1.10.13-1.el7.remi              @remi-safe 
php80-php-pecl-zip.x86_64          1.20.0-1.el7.remi                 @remi-safe 
php80-php-process.x86_64           8.0.15-1.el7.remi                 @remi-safe 
php80-php-xml.x86_64               8.0.15-1.el7.remi                 @remi-safe 
php80-runtime.x86_64               1.0-3.el7.remi                    @remi-safe
in flag
`yum search` does not install anything, it only shows you available packages. CentOS 7 does ship php8, you will need to add a third party repository to be able to install it. If you did that, please show the installed php8 packages.
fahad shaikh avatar
pl flag
Updated the question with installed php packages
Score:1
jp flag

Using remi repository, proper configuration and installation explained by the Wizard

You need mod_php, so (as for all extension / sapi)

yum install php80-mod_php

This module is provided by the php80-php package.

Notice: a better configuration is to use FPM, this is now the default configuration in CentOS 8 and 9.

You can read PHP Configuration Tips (for official SCL, up to 7.3, but also work with SCL from remirepo).

Notice: if you need a single version better to use php-* packages as php80-php-* package are designed for parallel installation of multiple versions, as explained by the Wizard.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.