File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,23 @@ static int
437
437
php_apache_server_startup (apr_pool_t * pconf , apr_pool_t * plog ,
438
438
apr_pool_t * ptemp , server_rec * s )
439
439
{
440
+ void * data = NULL ;
441
+ const char * userdata_key = "apache2filter_post_config" ;
442
+
443
+ /* Apache will load, unload and then reload a DSO module. This
444
+ * prevents us from starting PHP until the second load. */
445
+ apr_pool_userdata_get (& data , userdata_key , s -> process -> pool );
446
+ if (data == NULL ) {
447
+ /* We must use set() here and *not* setn(), otherwise the
448
+ * static string pointed to by userdata_key will be mapped
449
+ * to a different location when the DSO is reloaded and the
450
+ * pointers won't match, causing get() to return NULL when
451
+ * we expected it to return non-NULL. */
452
+ apr_pool_userdata_set ((const void * )1 , userdata_key ,
453
+ apr_pool_cleanup_null , s -> process -> pool );
454
+ return OK ;
455
+ }
456
+
440
457
tsrm_startup (1 , 1 , 0 , NULL );
441
458
sapi_startup (& apache2_sapi_module );
442
459
apache2_sapi_module .startup (& apache2_sapi_module );
You can’t perform that action at this time.
0 commit comments