Topic: Compiling SRC RPMs locally

Hi,

I've been looking at compiling the PHP 5.4.40 package locally using mock etc. on a development environment, so we can support the same builds on all our platforms.

I've been using the following method:

// Follow Apache documents at httpd.apache.org/docs/2.4/platform/rpm.html to build apache, and add it to a local repo

rpm -ivh php54-php-5.4.40-1.remi.src.rpm from remi's site
// Edit spec to always use Apache 2.4 on our systems
rpmbuild --nodeps -bs php.spec
cd ..../SRPMS/
sudo mock -v -r /etc/mock/epel-6-x86_64.cfg  php-5.4.40-1.el6.src.rpm
// Also build some of the child dependancies in this way, adding to a local repo

Each time it seems to build successfully and doing:

php -i

at the CLI works...

However, if I add it to Apache then I start getting the following:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/curl.so' - /usr/lib64/php/modules/curl.so: undefined symbol: file_globals in Unknown on line 0

Any ideas?

Re: Compiling SRC RPMs locally

> PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/curl.so' - /usr/lib64/php/modules/curl.so: undefined symbol: file_globals in Unknown on line 0

NTS vs ZTS build.


With apache 2.4, simply don't use mod_php, but php-fpm which is far better (especially if you want to use Apache with worker/event MPM).

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

Re: Compiling SRC RPMs locally

Remi wrote:

NTS vs ZTS build.

I'm confused why doing a build on your src RPM would build one part one way, and other parts a different way though?

Re: Compiling SRC RPMs locally

This happens when apache is configured in threaded mode.
PHP have an option to force ZTS build, but no option to force NTS build.

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

Re: Compiling SRC RPMs locally

Ah, thanks :-)

I'll look at php-fpm shortly then!