tags:

views:

23

answers:

1

Hi,

I have a script that has ignore_user_abort(TRUE); at the top and I call it like this

$socket = curl_init("http://...");
curl_setopt($socket, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($socket, CURLOPT_TIMEOUT_MS, 1000);
$result = curl_exec ($socket);
curl_close($socket);

This script does some boring work that I want to run in the background and judging from the result the script starts to do that work but shortly after that it stops. I've tried everything I know and I am really stuck now. May be there is some server config that can be blocking ignore_user_abort()? Please let me know if you have any ideas about this.

PS. set_time_limit() is set to a high value and cpanel is catching all errors into the error log so it is not dying of a fatal error.

A: 
curl_setopt($socket, CURLOPT_TIMEOUT_MS, 1000);

here you define the maximum number of milliseconds to allow cURL functions to execute as 1000...so you are allowing your curl function to run only for one second....maybe this is it

http://php.net/manual/en/function.curl-setopt.php

rabidmachine9
Yeah, that's right but the script that I am accessing with CURL has ignore_user_abort(TRUE); so it is not supposed to stop after CURL closes connection.
Eugene