3333ZEND_TSRMLS_CACHE_DEFINE ()
3434#endif
3535
36- /* Timeouts are currently fundamentally broken with ZTS except on Linux and
37- * FreeBSD: https://bugs.php.net/bug.php?id=79464 */
38- #ifndef ZEND_MAX_EXECUTION_TIMERS
39- static const char HARDCODED_INI [] = "max_execution_time=0\n"
40- "max_input_time=-1\n\0" ;
41- #endif
42-
4336static const char * MODULES_TO_RELOAD [] = {"filter" , "session" , NULL };
4437
4538frankenphp_version frankenphp_get_version () {
@@ -900,25 +893,18 @@ static void *php_main(void *arg) {
900893
901894 sapi_startup (& frankenphp_sapi_module );
902895
903- #ifndef ZEND_MAX_EXECUTION_TIMERS
904- #if ( PHP_VERSION_ID >= 80300 )
905- frankenphp_sapi_module . ini_entries = HARDCODED_INI ;
896+ #ifdef ZEND_MAX_EXECUTION_TIMERS
897+ /* overwrite php.ini with custom user settings */
898+ char * php_ini_overrides = go_get_custom_php_ini (false) ;
906899#else
907- frankenphp_sapi_module .ini_entries = malloc (sizeof (HARDCODED_INI ));
908- if (frankenphp_sapi_module .ini_entries == NULL ) {
909- perror ("malloc failed" );
910- exit (EXIT_FAILURE );
911- }
912- memcpy (frankenphp_sapi_module .ini_entries , HARDCODED_INI ,
913- sizeof (HARDCODED_INI ));
900+ /* overwrite php.ini with custom user settings and disable
901+ * max_execution_timers */
902+ char * php_ini_overrides = go_get_custom_php_ini (true);
914903#endif
915- #else
916- /* overwrite php.ini with custom user settings */
917- char * php_ini_overrides = go_get_custom_php_ini ();
904+
918905 if (php_ini_overrides != NULL ) {
919906 frankenphp_sapi_module .ini_entries = php_ini_overrides ;
920907 }
921- #endif
922908
923909 frankenphp_sapi_module .startup (& frankenphp_sapi_module );
924910
@@ -938,13 +924,13 @@ static void *php_main(void *arg) {
938924 tsrm_shutdown ();
939925#endif
940926
941- #if (PHP_VERSION_ID < 80300 )
942927 if (frankenphp_sapi_module .ini_entries ) {
943- free (frankenphp_sapi_module .ini_entries );
928+ free (( char * ) frankenphp_sapi_module .ini_entries );
944929 frankenphp_sapi_module .ini_entries = NULL ;
945930 }
946- #endif
931+
947932 go_frankenphp_shutdown_main_thread ();
933+
948934 return NULL ;
949935}
950936
0 commit comments