Answer the question
In order to leave comments, you need to log in
How to divide parsing into stages?
Wrote a parser. Takes a link from a .csv file, looks for other links, writes everything to a new .csv file.
There are about 200 links in the initial file. As a result, the script works for a long time. But it cuts off with a 504 error. Although I increased the script's running time to infinity in php.ini.
Question. How to make the parser parse step by step. So that I can see that the first link was successfully parsed. And so that there is no 504 error? Ajax if I can use anything. I understand how to receive data in the opposite direction and display it on the screen.
The question is - how to make the .php file of the parser run every time anew?
Answer the question
In order to leave comments, you need to log in
504 is gateway time-out - it means that there is some server in front of your php that still has a timeout and stops execution by this timeout.
In any case, running any parsing scripts through the browser is a very bad idea.
Log in through the console and run as a console script.
Use try catch depending on which version of php you are using catch errors with Exceptioon or Throwable When you catch an error, handle it there you can restart everything very easily and you don't have to fuss.
Catch the error write how to handle it apparently you will not have such a large pool of them
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question