Echo messages while php script still executes

前端 未结 9 1048
轻奢々
轻奢々 2021-02-08 13:05

I have a php script that uses cURL and takes about 10-15 minutes to execute. What it does, it parses about 1000 pages looking for specific matches and throughout the script I ha

9条回答
  •  太阳男子
    2021-02-08 13:25

    Actually you're looking for something like flush and ob_flush, however bear in mind that there are a lot of factors that can prevent your output from being flush'd as it happens.

    From the flush documentation you'll get:

    Several servers, especially on Win32, will still buffer the output from your script until it terminates before transmitting the results to the browser.

    Server modules for Apache like mod_gzip may do buffering of their own that will cause flush() to not result in data being sent immediately to the client.

提交回复
热议问题