Topic: php54 + httpd 246 - mpm event and thread safe issue

Hello,

I'm trying to create RPMs for Centos 6 (for the first time).

1. For apache, I used the spec included in the official tarball (2.4.6.tar.bz2)

All is ok, apache rpms can be installed and apache can be launched.

by default, here is our conf :
apachectl -V
Server MPM:     event
threaded:     yes (fixed thread count)
forked:     yes (variable process count)


2. For php54 (5.4.22), I tried to create rpm from the remi php54.spec but it seems to require a version of libicu-devel > 50, and this version is not available on Centos. It also ensure than current apache use prefork MPM :
apachectl -V | grep -q 'threaded:.*yes' && exit 1

I also tried with the php54.spec from iuscommunity-pkg, they don't require the libicu-devel version and the type of mpm used by apache.

In the 2 cases (after the creation/installation of php54 rpms), I found that php can't be loaded if apache is on mpm-event type.

Error : "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."

Is there a reason ? Why event can't be used ? how to do if it's possible to permit the use of mpm-event ?

Many thanks for your support smile

CEDJAR

Re: php54 + httpd 246 - mpm event and thread safe issue

> it seems to require a version of libicu-devel > 50
libicu-last is in my repo.

> It also ensure than current apache use prefork
Yes.
At build time, apache MUST be in prefork, as PHP have no option to force NTS mode, but have one to force ZTS mode.

But my spec build both NTS and ZTS module.

My binary RPM work nicely in NTS and ZTS mode.
Well, ZTS mode is not really supported by PHP project, So, with apache 2.4 in worker or event mode, I rather recomend the use of mod_proxy_fcgi and php-fpm.

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