我不确定是死锁还是否。 但是在出现此问题之前,我将curl用于同一台服务器。
我一直在寻找这个问题, https://stackoverflow.com/search?q=deadlock+curl
但这不能解决问题。
<pre>
<?php
session_write_close();
// session_start([
// 'cookie_lifetime' => 86400,
// 'read_and_close' => true,
// ]);
echo 'ada';
print_r($_SESSION);
print_r($_SERVER);
echo'wow';
// die();
$curl = curl_init();
$data = "waidiidwada";
curl_setopt_array($curl, array(
CURLOPT_URL => "https://hooks.slack.com/services/aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_POSTFIELDS => "{\"text\":\"$data\"}",
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Accept-Encoding: gzip, deflate",
"Cache-Control: no-cache",
"Connection: keep-alive",
"Content-Length: 24",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
session_start();
?>
</pre>
答案 0 :(得分:-2)
已解决。
我删除此行
"Accept: */*",
"Accept-Encoding: gzip, deflate",
"Cache-Control: no-cache",
"Connection: keep-alive",
"Content-Length: 24",