Bug #75314 [Opn]: apache2handler configure error, httpd.conf not found
Edit report at https://bugs.php.net/bug.php?id=75314&edit=1
ID: 75314
User updated by: info-bugsphp at ch2o dot info
Reported by: info-bugsphp at ch2o dot info
Summary: apache2handler configure error, httpd.conf not found
Status: Open
Type: Bug
Package: Compile Failure
Operating System: Linux
PHP Version: 7.0Git-2017-10-05 (Git)
Block user comment: N
Private report: N
New Comment:
new patch :
PHP_BUILD_THREAD_SAFE
fi
else
- APACHE_THREADED_MPM=$APXS_HTTPD -V | grep 'threaded:.*yes'
+ if test -n "$enable_maintainer_zts"; then
+ APACHE_THREADED_MPM="yes"
+ else
+ APACHE_MODULE_DIR=$APXS -q libexecdir
+ APACHE_MODULE_BASE_DIR=dirname $APACHE_MODULE_DIR
+ touch /tmp/php-httpd$$.conf
+ APACHE_THREADED_MPM=$APXS_HTTPD -V 2>&1 | grep 'threaded:.*yes'
+ if test -n "$APACHE_THREADED_MPM"; then
+ PHP_BUILD_THREAD_SAFE
+ else
+ APACHE_THREADED_MPM=$APXS_HTTPD -f /tmp/php-httpd$$.conf -V -d $APACHE_MODULE_BASE_DIR
-C "ErrorLog /tmp/logs.log" -C "LoadModule mpm_worker_module
modules/mod_mpm_worker.so" 2>&1 | grep 'threaded:.*yes'
+ if test -n "$APACHE_THREADED_MPM"; then
+ PHP_BUILD_THREAD_SAFE
+ else
+ APACHE_THREADED_MPM=$APXS_HTTPD -f /tmp/php-httpd$$.conf -V -d
$APACHE_MODULE_BASE_DIR -C "ErrorLog /tmp/logs.log" -C "LoadModule mpm_event_module
modules/mod_mpm_event.so" 2>&1 | grep 'threaded:.*yes'
if test -n "$APACHE_THREADED_MPM"; then
PHP_BUILD_THREAD_SAFE
fi
fi
+ fi
+ rm -f /tmp/php-httpd$$.conf
+ fi
+ fi
AC_MSG_RESULT(yes)
PHP_SUBST(APXS)
else
Previous Comments:
------------------------------------------------------------------------
[2017-11-29 19:09:05] info-bugsphp at ch2o dot info
possible modification of the config.m4:
PHP_BUILD_THREAD_SAFE
fi
else
- APACHE_THREADED_MPM=$APXS_HTTPD -V | grep 'threaded:.*yes'
+ if test -n "$enable_maintainer_zts"; then
+ APACHE_THREADED_MPM="yes"
+ else
+ APACHE_MODULE_DIR=$APXS -q libexecdir
+ APACHE_MODULE_BASE_DIR=dirname $APACHE_MODULE_DIR
+ touch /tmp/php-httpd$$.conf
+ APACHE_THREADED_MPM=$APXS_HTTPD -f /tmp/php-httpd$$.conf -V -d $APACHE_MODULE_BASE_DIR
-C "ErrorLog /tmp/logs.log" -C "LoadModule mpm_worker_module
modules/mod_mpm_worker.so" 2>&1 | grep 'threaded:.*yes'
+ if test -n "$APACHE_THREADED_MPM"; then
+ echo "Build thread Safe"
+ PHP_BUILD_THREAD_SAFE
+ else
+ APACHE_THREADED_MPM=$APXS_HTTPD -f /tmp/php-httpd$$.conf -V -d
$APACHE_MODULE_BASE_DIR -C "ErrorLog /tmp/logs.log" -C "LoadModule mpm_event_module
modules/mod_mpm_event.so" 2>&1 | grep 'threaded:.*yes'
if test -n "$APACHE_THREADED_MPM"; then
+ echo "Build thread Safe"
PHP_BUILD_THREAD_SAFE
fi
fi
+ rm -f /tmp/php-httpd$$.conf
+ fi
+ fi
AC_MSG_RESULT(yes)
PHP_SUBST(APXS)
else
------------------------------------------------------------------------
[2017-10-05 11:02:20] info-bugsphp at ch2o dot info
the config.m4 part that bug:
else
APACHE_THREADED_MPM=$APXS_HTTPD -V | grep 'threaded:.*yes'
if test -n "$APACHE_THREADED_MPM"; then
PHP_BUILD_THREAD_SAFE
fi
fi
------------------------------------------------------------------------
[2017-10-05 11:01:07] info-bugsphp at ch2o dot info
Description:
------------
when user configure script to configure apache2handler with apache 2.4 compiled mpm loadable... and
the default httpd.conf are not existing...
the configure script fail with this error:
httpd: Could not open configuration file
/product/apache/moteur/apache2-all-mpms-2.4.23/conf/httpd.conf: No such file or directory
after reading the config.m4, is why you search if apache are compiled with an mpm multithread using
the command httpd -V...
is a bad thing... beceause in apache 2.4 you can choose mpm at runtime... you depend on
httpd.conf... that load event, prefork, worker mpm... you cannot know in that way if mpm threaded
are compiled... if the default httpd.conf compiled in httpd binary not load threaded mpm at
configure time... you dont compile php in thread safe mode...
i think the good way is to add configure directive to abel to overide this autoconfiguration. like
--apache2-threaded=yes...
or ndisable autoconfigure if configure script directive --enable-maintainer-zts is set...
or the other way is to query EXTRA_CFLAGS to find "thread" flag but can be os dependent...
or doing ldd on httpd binary to find thread library:
# ldd /path/to/bin/httpd | grep thread
or check presence in modules directory of mod_mpm_event.so or mod_mpm_worker.so, or other mpm thread
module... but is dependant of the apache mpm module list... or to check if on of then modules are
compiled with thread library (with ldd)...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75314&edit=1
Thread (5 messages)