5 ms·
PHP is now run mainly as fcgi server. For streaming data that needs some fix on the server side so that the http server doesn't try to fetch the complete page b
by habibur 5y ago
PHP is now run mainly as fcgi server. For streaming data that needs some fix on the server side so that the http server doesn't try to fetch the complete page before sending that data to client. And I am not sure how to achieve that.
This wasn't a problem 12 years back as then Apache's mod_php had been the default way to serve pages. Your http server was the PHP interpreter.
- nolok 5y agoYou need to disable fcgi buffering in whatever http server you're using. For exemple in nginx, the option name is "fastcgi_buffering". Then flush() and the likes will work again. Note that if enabled you need to disable gzip compression too since that has its own buffering. Buffering can still be accomplished php side when needed with ob_ functions.
- toxik 5y agoThere is the sendfile header, but IIRC that’s not how shoutcast works. There are newer standards that do actually use individual requests for each segment, this is how you do it with web video.
- ipaddr 5y agomod_php is still the most popular and fastest way.
- sysop_ 5y agoI already ran into apache issues back then, that's why there is a line in the script to stop apache to do chucking or buffering for example: header("Content-Length: ".$settings["max_listen_time"] * $settings["bitrate"] * 128); //suppreses chuncked transfer-encoding