doulingqiu4349 2014-09-15 08:42
浏览 103
已采纳

php curl_exec死掉并退出脚本并显示白屏

this is my code: when i try to connect to whm/Cpanel to add new account this issue occure but when i try to delete a user from whm/cpanel it works perfect. my problem is curl_exec line die and show me blank white screen there isn't any error on the page and curl_error didn't return anything codes after curl_exec didn't run at all.

Thanks for your answers

$curl = curl_init();
# Create Curl Object
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
# Allow certs that do not match the domain
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
# Allow self-signed certs
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
# Return contents of transfer on curl_exec
$header[0] = "Authorization: WHM $cpanel_user:" . preg_replace("'(|
)'", "", $whmhash);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1800);
# Remove newlines from the hash
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
# Set curl header
curl_setopt($curl, CURLOPT_URL, $command);
# Set your URL
curl_setopt($curl, CURLOPT_FAILONERROR, FALSE);

curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
if( ! $result = curl_exec($curl))
{
    trigger_error(curl_error($curl));
} 

$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
# Execute Query, assign to $result
if ($result == false) {
    error_log("curl_exec threw error \"" . curl_error($curl) . "\" for $query");
}
curl_close($curl);
  • 写回答

2条回答 默认 最新

  • duanmen1887 2015-01-04 22:07
    关注

    The problem was nginx that didn't allow the response came back to my code. by disabling nginx on server that working on proxy mode for apache it solved.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵