My problem is that I want to kill the script after 58 seconds. But max_execution_time
just tracks the time of the script execution itself, not my curl call. I could get the time in the beginning of the script and the calculate the time, but I can't do that while my curl is executing. Is there any solution that fit my needs? I don't want to start another thread that tracks the time.
Asked
Active
Viewed 82 times
0

Don't Panic
- 13,965
- 5
- 32
- 51
-
https://stackoverflow.com/questions/2582057/setting-curls-timeout-in-php – Marty Oct 10 '19 at 09:18
-
`curl_setopt($ch , CURLOPT_TIMEOUT_MS , 58000);` – YvesLeBorg Oct 10 '19 at 09:19
-
I ve already set those options, the problem is im doing up to 9 curl calls and each has a set timeout of 10s, thats why i need the overall time and if needed kill the process while curl is running – Aflrodo143 Oct 10 '19 at 09:23
-
i could check the time after every call but this would have a tolerance of +-10 seconds. – Aflrodo143 Oct 10 '19 at 09:25
-
and i don't really want to use the pthread package, because i want the script to stay protable – Aflrodo143 Oct 10 '19 at 09:26