Topic: libphp.so 8.1 file

Hi all,

I have RHEL 8.7 with single version of PHP 7.4 (remi-modular) in production.

# php -v
PHP 7.4.33 (cli) (built: Oct 31 2022 10:36:05) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
   
I have installed PHP 8.1 to test on a website with remi-safe

# php81 -v
PHP 8.1.13 (cli) (built: Nov 22 2022 14:42:07) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies
   
What package do I have to install to get the libphp.so (version 8.1) file for Apache?
I don't see it.

Thanks you! Bye.

Re: libphp.so 8.1 file

libphp.so (aka mod_php) is provided in php81-php package

BUT:
In EL-8, mod_php is no more used by default, but FPM.

So you need to install php81-php-fpm and start the service.

Notice: in multiple versions mode, you will have to set the proper SetHandler for each vhost / app to select the PHP version used.

Also notice that mod_php doesn't allow multiple versions.

Laptop:  Fedora 40 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: AlmaLinux 8 with EPEL, rpmfusion, remi

Re: libphp.so 8.1 file

I need php-module (libphp.so) for my "prefork" backend apache with PHP81 (remi-safe). I donwloaded this file (libphp.so) from rpms.remirepo.net/enterprise/8/modular/x86_64/php-8.1.13-1.el8.remi.x86_64.rpm and I installed it in /usr/lib64/httpd/modules/libphp.so (only this file)

My other MPM frontend apache work with PHP 7.4 (remi-modular) and it acts as a proxy for the other apache.

My problem now is that mysqli extension are not seen through php-module 8.1. But if I run the php file directly in console it works fine.
ok -> # php81 -f ./test.php     
ko -> myserver.com/myurl/test.php

if I execute myserver.com/myurl/phpinfo.php, its work fine, but i don't see any section about mysqli, mysqlnd o pod_mysql.

What's happend?

Re: libphp.so 8.1 file

What a mess...

> I donwloaded this file (libphp.so) from rpms.remirepo.net/enterprise/8/modular/x86_64/php-8.1.13-1.el8.remi.x86_64.rpm and I installed it in /usr/lib64/httpd/modules/libphp.so (only this file)

sorry but I cannot support such a hackish thing

You should really switch to FPM, which is perfectly designed for such use cases (multi-versions)

Read this old post (with explanation about why FPM):
https://developers.redhat.com/blog/2017 … ation-tips

And this one
https://blog.remirepo.net/post/2022/02/ … orkstation

Laptop:  Fedora 40 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: AlmaLinux 8 with EPEL, rpmfusion, remi