tags:

views:

10

answers:

1

I'm executing a curl command from php in background,
that uses curl_exec to retrieve some data and something is wrong...

when i try to pass post data to curl_exec script:

exec('curl --data "'.$post_string.'" '.$post_url);

all fine, i get a 200 response, script finishes successfully

same command, but with "> /dev/null &":

exec('curl --data "'.$post_string.'" '.$post_url.' > /dev/null &');

returns (taken from curl_getinfo from $post_url)

http://somurlhere.com
0
0
0
-1
0
0
0.552842
0.51867
0.552705
0.552725
0
0
0
0
0
0
0
0 

How is that possible?
I'm doing something wrong?
I know that the script doesn't die, since it logs to a txt file at the end of execution...
Any ideas?

A: 

as i thought, just a stupid mistake, i was removing some data after executing the command, and since it's in background, i remove it before the second script gets a chance to access it, that was the problem =]

Simon