frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Support for max_execution_time and max_input_time

Open dunglas opened this issue 3 years ago • 1 comments

max_input_time and max_execution_time are currently disable as they conflict with ZTS.

PHP will need to be improved if we want to support these options: https://externals.io/message/118859

dunglas avatar Oct 21 '22 13:10 dunglas

I wonder if we could emulate this?

Provide a function in go (maybe go_register_execution_timers?) that is called during initialization in C by reading the settings from php.ini:

go_register_execution_timers(PG(max_execution_time));

Then in go, we create a timer and listen for the end of the request:

select {
  case <- httpRequest.Context().Done():
  case <- time.After(maxExecutionTime):
}

// tell PHP to die if it is still alive

WDYT?

withinboredom avatar Nov 08 '22 15:11 withinboredom

Done for Linux. It will probably not be possible for mac and Windows.

dunglas avatar Jul 10 '23 18:07 dunglas