roel018 Posted August 28, 2009 Share Posted August 28, 2009 Hi all, I have written a script that get's a CGI video stream from my webcam's build-in server (streaming MJPEG content). The script just reads the incoming streaming data and outputs it into an HTML IMG tag. This works great on one server (my developer's server). However, on my online, shared hosting server (where it is supposed to run), it doesn't work - probably due to the fact that the failing server is buffering the incoming data (since phpinfo() tells me output_buffering is set to 4096 - and on the server where it does work on it is set to 0, well, actually it just says 'No value') .. In fact, it does spit put something (a whole lot of images in a fraction of a second) after it has downloaded the 4 mb of data, but then it starts buffering again.. So what do I do? Do I just mail my shared hosting provider and to set the output_buffering (local or master values? - I don't know the difference) to 0/NoValue ?? Or are there any other things I'm missing here to get this to work? One important other difference between the servers is that the server where it works on runs php version 5 and mine runs version 4.4.8 - Could this pose a problem as well??? (I can activate PHP 5 by request). phpiknfo() results from WORKING server: http://www.emotiontracker.com/test1-results-derek.htm phpiknfo() results from FAILING server: http://www.emotiontracker.com/test1-results-roel.htm Hope to get some insights into how to approach this problem P.s. it concerns a Windows Server so setting .htaccess is not an option. Thanks in advance! Roel. Quote Link to comment https://forums.phpfreaks.com/topic/172242-image-script-works-on-one-server-fails-on-other/ Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 output_buffering is PHP_INI_PERDIR so you can by using a .htaccess alter the buffer to 0 Quote Link to comment https://forums.phpfreaks.com/topic/172242-image-script-works-on-one-server-fails-on-other/#findComment-908166 Share on other sites More sharing options...
roel018 Posted August 28, 2009 Author Share Posted August 28, 2009 Well, i could if I used an Apache server, but I'm using Windows Server 2003 Here's the code: <?php header('Content-type: multipart/x-mixed-replace;boundary=endofsection'); print "\n--endofsection\n"; $pmt = array("-", "\\", "|", "/" ); for( $i = 0; $i <10; $i ++ ){ sleep(1); print "Content-type: text/plain\n\n"; print "Part $i\t".$pmt[$i % 4]; print "--endofsection\n"; ob_flush(); flush(); } print "Content-type: text/plain\n\n"; print "The end\n"; print "--endofsection--\n"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/172242-image-script-works-on-one-server-fails-on-other/#findComment-908235 Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 Windows Server 2003? Only 2008 can run PHP on IIS so 2003 would use Apache won't it? Quote Link to comment https://forums.phpfreaks.com/topic/172242-image-script-works-on-one-server-fails-on-other/#findComment-908285 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.