I’m using this package to run my bash:
use SymfonyComponentProcessProcess;
use SymfonyComponentProcessExceptionProcessFailedException;
I got this error when I want to run my bash inside laravel:
The process ***/my.sh exceeded the timeout of 60 seconds.
$process = new Process('sh ***/my.sh');
$process->run();
// executes after the command finishes
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
my max_execution_time
inside phpinfo
function is 240. I restarted my server.
my safe_mode
is off. I used this function :
set_time_limit(0);
above my code, but after 60 seconds I got the same error message.
my .htdaccess
is 240 seconds.
any idea?
2
Answers
The
Process
class has a timeout of its own, according to Process docs:You should check the
idleTimetout
as well, if the process may take a long time without outputing any data:The docs doesn’t say anything about using
0
as no limit.If you want to disable the
setTimeout
orsetIdleTimeout
completely, simply set them asnull
: