I am using Symfony to talk to the Office365 mail server, by calling a Symfony command, in a cronned process (every minute).
Apparently, occasionally something in that communication gets stuck and my php script keeps running - even after the next scheduled call happens, so then I have 2, then 3, then 4 scripts running in parallel.
Question is: how can I reliably limit the total duration of this Symfony command call to max. of 1 minute?
I'm saying "total duration" because I did try with setting the max_execution_time
, that is the set_time_limit(60)
, but apparently this setting doesn't count in any externals calls to other scripts - so any wait for the MX server to respond wouldn't be calculated.
I also thought to try with setting the max_input_time
but that didn't work in my case, out of 2 reasons: 1. apparently Symfony console somehow overwrites my regular php.ini value with a -1
and 2. I cannot set this setting manually inside the Symfony script. What ever I set to it, with ini_set("max_input_time", XX)
, it stays on the "infinite" value (of -1). Thank you!