ShivaGupta Posted May 26, 2013 Share Posted May 26, 2013 (edited) i have a working curl with no error... if i set to 5 time loop .............then working fine................... and if set loop to 10 or more ..........i have this error on fire fox.......................... The connection was reset The connection to the server was reset while the page was loading. The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web. i use this code for loop on linux hosting $i = 0; while($i != 50) { // Your code here $i++; } Edited May 26, 2013 by ShivaGupta Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/ Share on other sites More sharing options...
jazzman1 Posted May 26, 2013 Share Posted May 26, 2013 (edited) You are surprising me every time What's the common between "firefox" and "curl" here? EDIT: My fault, you could use firefox as a default userAgent Try this: $i = 0; while($i != 50) { // Your code here // sleep for 10 seconds sleep(10); $i++; } Edited May 26, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432381 Share on other sites More sharing options...
ShivaGupta Posted May 26, 2013 Author Share Posted May 26, 2013 (edited) You are surprising me every time What's the common between "firefox" and "curl" here? EDIT: My fault, you could use firefox as a default userAgent Try this: $i = 0; while($i != 50) { // Your code here // sleep for 10 seconds sleep(10); $i++; } same provlem sir. my script does not return anything to the browser until the query is fully completed. is their any way to return some data after every loop to the browser .... if I will try the flush() command to force PHP to send the page header before the query is run. then what hapan.?plzzzzzzzz tell Edited May 26, 2013 by ShivaGupta Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432385 Share on other sites More sharing options...
ShivaGupta Posted May 26, 2013 Author Share Posted May 26, 2013 (edited) i think the problem was with the browser. If the browser wouldn't receive any data from the server within a given period of time, about 30 seconds or so, it would give up on loading the page. i am right? if i am right so plz tell me how to fix script for send the buffered portion of the page that had been built to the browser. Edited May 26, 2013 by ShivaGupta Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432388 Share on other sites More sharing options...
jazzman1 Posted May 26, 2013 Share Posted May 26, 2013 As I said you before never used curl in php only in bash without GUI. To be honest I don't know where this problem comes from without testing the same script into my machine, maybe it comes from the remote machine, maybe from the local one. So, you could try to set output_buffering to the script to see what happens using ob_start() and ob_end_flush(). Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432389 Share on other sites More sharing options...
ShivaGupta Posted May 26, 2013 Author Share Posted May 26, 2013 As I said you before never used curl in php only in bash without GUI. To be honest I don't know where this problem comes from without testing the same script into my machine, maybe it comes from the remote machine, maybe from the local one. So, you could try to set output_buffering to the script to see what happens using ob_start() and ob_end_flush(). so plz give me a example code........... Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432392 Share on other sites More sharing options...
Solution jazzman1 Posted May 26, 2013 Solution Share Posted May 26, 2013 Try, // on the top of your script ob_start(); $i = 0; while($i != 50) { // Your code here // sleep for 10 seconds sleep(10); $i++; } //after the while loop ob_end_flush(); Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432396 Share on other sites More sharing options...
ShivaGupta Posted May 27, 2013 Author Share Posted May 27, 2013 (edited) Try, // on the top of your script ob_start(); $i = 0; while($i != 50) { // Your code here // sleep for 10 seconds sleep(10); $i++; } //after the while loop ob_end_flush(); CAN U TEsT the same script into ur machine for me.......... because i am unable to handle my provlem after a LOT OF TRY.........if yes i will send full code by msg Edited May 27, 2013 by ShivaGupta Quote Link to comment https://forums.phpfreaks.com/topic/278405-curl-erroron-wheel-loophelppls/#findComment-1432474 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.