Running concurrent PHP scripts

后端 未结 6 2086
孤独总比滥情好
孤独总比滥情好 2020-12-10 15:45

I\'m having the following problem with my VPS server.

I have a long-running PHP script that sends big files to the browser. It does something like this:



        
6条回答
  •  自闭症患者
    2020-12-10 16:28

    I have tried different approaches (reading and sending the files in small chunks [see comments on readfile in PHP doc], using PEARs HTTP_Download) but I always ran into performance problems when the files are getting big.

    There is an Apache mod X-Sendfile where you can do your business logic and then delegate the download to Apache. The download will not be publicly available. I think, this is the most elegant solution for the problem.

    More Info:

    • http://tn123.org/mod_xsendfile/
    • http://www.brighterlamp.com/2010/10/send-files-faster-better-with-php-mod_xsendfile/

提交回复
热议问题