summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2002-06-24 16:04:20 +0000
committerRasmus Lerdorf <rasmus@php.net>2002-06-24 16:04:20 +0000
commit890e01bebe03299d10f30f1decebcddaf128e4e8 (patch)
tree24a29dee337d492692e1e0d1e05dd650db7e95d0 /sapi
parent2fec25ad73100e5925e60e15934b4ab9bcaf9648 (diff)
downloadphp-git-890e01bebe03299d10f30f1decebcddaf128e4e8.tar.gz
@ Add runtime Apache2 thread check to ensure we don't run a non-threaded
@ PHP inside a threaded Apache2 MPM. (Rasmus)
Diffstat (limited to 'sapi')
-rw-r--r--sapi/apache2filter/sapi_apache2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 99771cbc7f..d4f0ad7bc8 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -40,6 +40,7 @@
#include "http_main.h"
#include "util_script.h"
#include "http_core.h"
+#include "ap_mpm.h"
#include "php_apache.h"
@@ -444,6 +445,15 @@ static void php_apache_add_version(apr_pool_t *p)
static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
{
+#ifndef ZTS
+ int threaded_mpm;
+
+ ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm);
+ if(threaded_mpm) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, 0, 0, "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.");
+ return DONE;
+ }
+#endif
/* When this is NULL, apache won't override the hard-coded default
* php.ini path setting. */
apache2_php_ini_path_override = NULL;