summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sapi/apache2filter/config.m45
-rw-r--r--sapi/apache2filter/sapi_apache2.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4
index 76248f6f8c..857b9ec03a 100644
--- a/sapi/apache2filter/config.m4
+++ b/sapi/apache2filter/config.m4
@@ -34,6 +34,7 @@ AC_ARG_WITH(apxs2,
APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
APXS_CFLAGS=`$APXS -q CFLAGS`
+ APXS_MPM=`$APXS -q MPM_NAME`
for flag in $APXS_CFLAGS; do
case $flag in
@@ -81,7 +82,9 @@ AC_ARG_WITH(apxs2,
esac
PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
- PHP_BUILD_THREAD_SAFE
+ if test "$APXS_MPM" != "prefork"; then
+ PHP_BUILD_THREAD_SAFE
+ fi
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index cb3b8d3701..99771cbc7f 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -428,7 +428,9 @@ php_apache_server_shutdown(void *tmp)
{
apache2_sapi_module.shutdown(&apache2_sapi_module);
sapi_shutdown();
+#ifdef ZTS
tsrm_shutdown();
+#endif
return APR_SUCCESS;
}
@@ -473,8 +475,9 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog,
if (apache2_php_ini_path_override) {
apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override;
}
-
+#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
+#endif
sapi_startup(&apache2_sapi_module);
apache2_sapi_module.startup(&apache2_sapi_module);
apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null);