While a process is running manually, it stops after a while in the cron job [duplicate]

Solution 1:

When you run the file manually, do you run it into a browser or in a console ? Running the php script using Cron, it use the CLI version of PHP instead of the CGI version and timeout configurations are differents between these two versions.

Check the CLI timemout of PHP on the server or add set_time_limit(xxx) on the beginning of your script.