Good day. In general, there was such a question.

I am writing a parser, initially performing the parsing of category pages, pages of about 4k +, while getting links to products that are about 10 on each page. When parsing a category, I get an array of links to products. Even without starting to parse the goods I rest against the hosting limit. How can I get around this limit, can someone advise? Thank you in advance.

  • 3
    eat an elephant in parts - rjhdby
  • Run the script in the console, not via the web server, because This is a console task. There, at least for months, the script will be executed. - ilyaplot
  • @ilyaplot is obtained the config specified in php.ini does not apply to scripts run in the console? - Yevgeny Ignatyev February
  • @YevgenyIgnatyev nobody canceled the timeout specified in the web server. Usually it is no more than 30 seconds. - ilyaplot
  • @rjhdby Variant, but without "pushing" into the limit I can only parse 10 pages, somehow it’s not very convenient to scroll 4k + pages of 10 units of each. Again, if this is all done in a loop, do you really want to end up with the limit or do you propose to do it asynchronously? - Yevgeny Ignatyev February

1 answer 1

упираюсь в лимит хостинга

Is it possible to ask the limit on what parameters? just have a memory and time.

 <?php ini_set('max_execution_time', 60*60*5); // 5 часов ini_set('memory_limit', '16000M'); // 16 GB RAM 
  • I know about the ini_set limit of script execution time, which is limited to 30 seconds, but I'm afraid that the hosting will not approve such a solution, so far I have been trying through the console, so far I have succeeded only to 1700 pages and 4k +, and after Fatal error - Yevgeny Ignatyev
  • hosting approve. so how do you pay for it your Deutsch Brand - fonjeekay
  • My opinion is that ini_set can be safely used. Do you have a hosting or server on Linux or what? - fonjeekay