An error occurred while submitting the curl Data in nginx. could you tell me: & nbsp; curl method data submission, which runs on the apache server. there is no problem. & Nbsp; in the nginx service, the execution result of curl_exec ($ ch) is false, and the php will stop running only after timeout, otherwise it will remain refreshed. & Nbsp; an error occurred while submitting nginx. c curl Data
Excuse me:
The curl method submits data and runs on the apache server.
In the nginx service, the execution result of curl_exec ($ ch) is false, and the php will stop running only after the timeout, otherwise it will remain refreshed.
How to Configure nginx. conf to solve this problem. Thank you.
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, 'http: // 192.168.247.138: 8181/a2.php ');
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_TIMEOUT, 3 );
$ Data = curl_exec ($ ch );
Curl_close ($ ch );
Var_dump ($ data );
?> Share:
------ Solution --------------------
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://192.168.247.138:8181/a2.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$data = curl_exec($ch);
var_dump($data);
curl_close($ch);