php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61172 With Apache 2.4.1, ./configure fails on APXS but stops only on the MySQL check.
Submitted: 2012-02-23 20:15 UTC Modified: 2012-03-02 00:09 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: antoine dot bajolet at tdf dot fr Assigned: sixd (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.10 OS: Linux 3.2.6 glibc 2.11.3
Private report: No CVE-ID: None
 [2012-02-23 20:15 UTC] antoine dot bajolet at tdf dot fr
Description:
------------
./configure PHP 5.3.10 fails when attempting to configure apache2handler DSO with apache 2.4.1.

-------------------------
./configure --prefix=/usr/local/ --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/ --with-mysql=/usr/local/mysql
[.../...]
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... apxs:Error: Invalid query string `MPM_NAME'.
yes
checking for Apache 1.x (hooks) module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support... no
checking whether to enable Apache charset compatibility option... no
checking for Caudium support... no
checking for CLI build... yes
checking for Continuity support... no
checking for embedded SAPI library support... no
checking for FPM build... no
checking for Zeus ISAPI support... no
checking for LiteSpeed support... no
checking for Milter support... no
[.../...]
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
-------------------------

The behavior is very confusing, because if i choose the Apache 2.2.x APXS, the MySQL checks work fine ! :

-------------------------
./configure --prefix=/usr/local/ --with-apxs2=/usr/local/apache2.2/bin/apxs --with-config-file-path=/usr/local/ --with-mysql=/usr/local/mysql
[.../...]
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... yes
checking for Apache 1.x (hooks) module support via DSO through APXS... no
[.../...]
checking for specified location of the MySQL UNIX socket... no
checking for mysql_close in -lmysqlclient... yes
checking for MySQL UNIX socket location... no
[.../...]
-------------------------

In fact, the error is in the apache worker check, because of with apache 2.4, the worker can be dynamically loaded, and not fixed at compile time : The MPM_NAME parameter doesn't exist anymore :

# /usr/local/apache2.2/bin/apxs -q MPM_NAME
prefork

# /usr/local/apache2.4/bin/apxs -q MPM_NAME
apxs:Error: Invalid query string `MPM_NAME'.

This is confirmed in the CHANGES file in the Apache 2.4.1 source, lines 1849 and below :
 *) Allow MPMs to be loaded dynamically, as with most other modules.  Use
     --enable-mpms-shared={list|"all"} to enable.  This required changes to
     the MPM interfaces.  Removed: mpm.h, mpm_default.h (as an installed
     header), APACHE_MPM_DIR, MPM_NAME, ap_threads_per_child,
     ap_max_daemons_limit, ap_my_generation, etc.  ap_mpm_query() can't be
     called until after the register-hooks phase.  [Jeff Trawick]


Expected result:
----------------
Apache 2.4.1 DSO properly configured.

Seems by the way difficult to auto-configure PHP with Apache 2.4 apxs now, because apxs doesn't returns any indication about default worker module or worker modules compiled :
Have to declare what worker module the user intends to use in Apache ?


Actual result:
--------------
./configure fails

Patches

bug61172.patch.txt (last revision 2012-02-28 22:57 UTC by sixd@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-23 22:31 UTC] johannes@php.net
This issue:

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!

Can be fixed by making sure that oyur MySQL installation contains the thread-safe version of libmysql or by using --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=myslqnd to use the PHP-specific mysqlnd library.

This won't solve the actual bug, though as you'll get a thread-safe PHP which one probably won't like as apxs -q MPM_NAME is not returning "prefork" (but an error)
 [2012-02-24 00:44 UTC] sixd@php.net
The following patch has been added/updated:

Patch Name: bug61172.patch.txt
Revision:   1330044292
URL:        https://bugs.php.net/patch-display.php?bug=61172&patch=bug61172.patch.txt&revision=1330044292
 [2012-02-24 00:49 UTC] sixd@php.net
Try the attached patch:

patch < bug61172.patch.txt
rm configure config.cache autom4ate.*
./buildconf --force
./configure ....
 [2012-02-24 06:11 UTC] antoine dot bajolet at tdf dot fr
The patch works fine, thanks.

PHP compiles to the end.

(Note I didn't change anything about mysql and i have no configure failure anymore).

Regards,
AB
 [2012-02-24 15:12 UTC] jpauli@php.net
Same problem here, apxs -q doesn't handle MPM anymore because of DSOs MPM in 
Apache 2.4, I get a ZTS PHP at final whatever happens (no errors)

The patch works fine, I suggest we merge it to 5.3 and 5.4 branches
 [2012-02-24 19:20 UTC] sixd@php.net
The following patch has been added/updated:

Patch Name: bug61172.patch.txt
Revision:   1330111204
URL:        https://bugs.php.net/patch-display.php?bug=61172&patch=bug61172.patch.txt&revision=1330111204
 [2012-02-28 22:57 UTC] sixd@php.net
The following patch has been added/updated:

Patch Name: bug61172.patch.txt
Revision:   1330469853
URL:        https://bugs.php.net/patch-display.php?bug=61172&patch=bug61172.patch.txt&revision=1330469853
 [2012-03-01 10:57 UTC] drak@php.net
The patch also works for me too, +1 for getting this into the trunk and 5.3 
branches.
 [2012-03-02 00:07 UTC] sixd@php.net
Automatic comment from SVN on behalf of sixd
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=323750
Log: Fixed bug #61172 (Add Apache 2.4 support)
 [2012-03-02 00:08 UTC] sixd@php.net
Fixed in PHP 5.3.11 and PHP 5.4.1 (and trunk)
 [2012-03-02 00:08 UTC] sixd@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: sixd
 [2012-04-18 09:45 UTC] laruence@php.net
Automatic comment on behalf of sixd
Revision: http://git.php.net/?p=php-src.git;a=commit;h=730b54a3744035042cd4d738579c63bf15cc7384
Log: Fixed bug #61172 (Add Apache 2.4 support)
 [2012-07-24 23:37 UTC] rasmus@php.net
Automatic comment on behalf of sixd
Revision: http://git.php.net/?p=php-src.git;a=commit;h=730b54a3744035042cd4d738579c63bf15cc7384
Log: Fixed bug #61172 (Add Apache 2.4 support)
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of sixd
Revision: http://git.php.net/?p=php-src.git;a=commit;h=730b54a3744035042cd4d738579c63bf15cc7384
Log: Fixed bug #61172 (Add Apache 2.4 support)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC