D
D
damarkuzz2021-05-02 11:27:47
PHP
damarkuzz, 2021-05-02 11:27:47

How to split the execution of a PHP script into parts?

There is a script that performs parsing from some site. In Apache settings I Timeouthave 300. At the end of the specified time, the script ends, error 500 is displayed. How to split the script into several parts, 300 for each?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John Didact, 2021-05-02
@JohnDidact

damarkuzz , since I saw in the comments that the task is to run the script by cron, then, in my opinion, although noobian, but correct, a solution with running the script from the command line will suit you.
1) Using PHP on the command line
2) Executing PHP files in the CLI
3) Main differences from other SAPI implementations :

PHP running in the console is generally used for a wider range of tasks than regular web scripts. And since they can take a very long time to complete, the maximum execution time is unlimited.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question