Am trying to increase script execution time for a curl request in php for uploading a very large files.
I Can set the curl timeout as follows
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
Now I need to ensure that php script does not timeout as well. Am confused on the approached to be implemented irrespective of whether the server is running Apache or Nginx or IIS etc.
Some articles suggest that max_execution_time
is good since it uses ini_set()
and that you can gets its results using init_get()
while some scholars suggest the use set_time_limit
saying that max_execution_time
is only to be used when running apache.
Am really confused as my coconut head keeps cracking. Any suggestions on the best way to go will be appreciated
1.) Am I to use max_execution_time or set_time_limit or should I use both
ini_set('max_execution_time', 300); // 5 miutes
set_time_limit(300);
2.)Again In which scenario is max_execution_time preferable over set_time_limit and vice versa.