We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b3408c commit 23040e4Copy full SHA for 23040e4
frankenphp.c
@@ -1399,6 +1399,10 @@ static void *execute_script_cli(void *arg) {
1399
void *exit_status;
1400
bool eval = (bool)arg;
1401
1402
+#ifndef PHP_WIN32
1403
+ pthread_atfork(NULL, NULL, frankenphp_fork_child);
1404
+#endif
1405
+
1406
/*
1407
* The SAPI name "cli" is hardcoded into too many programs... let's usurp it.
1408
*/
@@ -1423,6 +1427,12 @@ static void *execute_script_cli(void *arg) {
1423
1427
}
1424
1428
zend_end_try();
1425
1429
1430
1431
+ if (is_forked_child) {
1432
+ _exit(EG(exit_status));
1433
+ }
1434
1435
1426
1436
exit_status = (void *)(intptr_t)EG(exit_status);
1437
1438
php_embed_shutdown();
0 commit comments