开发者

posting data with curl_exec on background returns 0's

开发者 https://www.devze.com 2023-01-22 11:43 出处:网络
I\'m executing a curl command from php in background, that uses curl_exec to retrieve some data and something is wrong...

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/n开发者_StackOverflow中文版ull &');

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?


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 =]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号