Skip to content

Commit 65bd8d2

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix bug #80728: Don't reset the timeout on ini deactivate
2 parents 5d612ae + 98a21d1 commit 65bd8d2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

NEWS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ PHP NEWS
77
(cmb, Nikita)
88
. Fixed bug #81163 (incorrect handling of indirect vars in __sleep).
99
(krakjoe)
10-
. Fixed bug #81159 (Object to int warning when using an object as a string offset).
11-
(girgias)
10+
. Fixed bug #81159 (Object to int warning when using an object as a string
11+
offset). (girgias)
12+
. Fixed bug #80728 (PHP built-in web server resets timeout when it can kill
13+
the process). (Calvin Buckley)
1214

1315
- Intl:
1416
. Fixed bug #72809 (Locale::lookup() wrong result with canonicalize option).

main/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,15 @@ static PHP_INI_MH(OnUpdateTimeout)
406406
}
407407
zend_unset_timeout();
408408
ZEND_ATOL(EG(timeout_seconds), ZSTR_VAL(new_value));
409-
zend_set_timeout(EG(timeout_seconds), 0);
409+
if (stage != PHP_INI_STAGE_DEACTIVATE) {
410+
/*
411+
* If we're restoring INI values, we shouldn't reset the timer.
412+
* Otherwise, the timer is active when PHP is idle, such as the
413+
* the CLI web server or CGI. Running a script will re-activate
414+
* the timeout, so it's not needed to do so at script end.
415+
*/
416+
zend_set_timeout(EG(timeout_seconds), 0);
417+
}
410418
return SUCCESS;
411419
}
412420
/* }}} */

0 commit comments

Comments
 (0)