php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75314 apache2handler configure error, httpd.conf not found
Submitted: 2017-10-05 11:01 UTC Modified: 2017-11-29 19:12 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: info-bugsphp at ch2o dot info Assigned:
Status: Open Package: Compile Failure
PHP Version: 7.0Git-2017-10-05 (Git) OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info-bugsphp at ch2o dot info
New email:
PHP Version: OS:

 

 [2017-10-05 11:01 UTC] 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)...




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-05 11:02 UTC] 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-11-29 19:09 UTC] 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-11-29 19:12 UTC] info-bugsphp at ch2o dot info
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
 [2021-09-11 11:37 UTC] ufc28496 at gmail dot com
play klondike solitaire card games https://solitaire-klondike.net then invite your classmate and close friends.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC