Jump to content

curl error.........on wheel loop..........help.....pls


ShivaGupta
Go to solution Solved by jazzman1,

Recommended Posts

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 by ShivaGupta
Link to comment
Share on other sites

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 by jazzman1
Link to comment
Share on other sites

 

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 by ShivaGupta
Link to comment
Share on other sites

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 by ShivaGupta
Link to comment
Share on other sites

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().

Link to comment
Share on other sites

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...........

Link to comment
Share on other sites

 

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 by ShivaGupta
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.