I have a bunch of scripts that take a lot of time. Some may take up to 20 minutes.
Here's the Bash script that runs these PHP scripts. When I call this Bash script through the CLI as root, all PHP scripts end without problems. But when I call the Bash script using the PHP exec () function through the browser, the scripts suddenly stop after 7/8 minutes without any errors.
Is there a certain restriction on the execution time of a process or script when executed through Apache / PHP?
I tried:
set_time_limit(0)exec('nohup /path/to/bashscript')exec('/path/to/bashscript | at now')
The last two recommended solutions were recommended by others who had problems with long scenarios, but that doesn't help me at all.
Note: The
Bash script that runs PHP scripts is a CakePHP console application. I have to execute PHP scripts through this Bash script in order to use all CakePHP functions (models, shell methods, etc.). And I need to be able to call the Bash script through the browser and let it work in the background.
The server is a VPS and WHM / cPanel is installed.
Botch source
share