douke1891 2015-06-16 15:56
浏览 31

showbw()---致命错误:未捕获异常'异常',消息'curl_exec引发错误“

I updated my WHM 11.50.0.10 yesterday, I use Xmlapi API to manage my bills, gave error band (Traffic) use the showbw () function. I do not know what happened now no longer works. See the error!

Fatal error: Uncaught exception 'Exception' with message 'curl_exec threw error "" for https://000.000.000.00:2087/xml-api/showbw?' in /home/controle/public_html/conseld/Servidor/xmlapi.php:759 Stack trace: #0 /home/controle/public_html/conseld/Servidor/xmlapi.php(676): xmlapi->curl_query('https://000.000...', '', 'Authorization: ...') #1 /home/controle/public_html/conseld/Servidor/xmlapi.php(2136): xmlapi->xmlapi_query('showbw') #2 /home/controle/public_html/conseld/InformacaoConta/informacao.php(175): xmlapi->showbw() #3 /home/controle/public_html/conseld/ListarConta/fullTab.php(175): include_once('/home/controle/...') #4 {main} thrown in /home/controle/public_html/conseld/Servidor/xmlapi.php on line 7

Error line (759) file -->xmlapi.php

throw new Exception("curl_exec threw error \"" . curl_error($curl) . "\" for " . $url . "?" . $postdata );

private function curl_query( $url, $postdata, $authstr )
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
// Return contents of transfer on curl_exec
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Allow self-signed certs
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
// Set the URL
curl_setopt($curl, CURLOPT_URL, $url);
// Increase buffer size to avoid "funny output" exception
curl_setopt($curl, CURLOPT_BUFFERSIZE, 131072);

// Pass authentication header
$header[0] =$authstr .
"Content-Type: application/x-www-form-urlencoded
" .
"Content-Length: " . strlen($postdata) . "
" . "
" . $postdata;

curl_setopt($curl, CURLOPT_HTTPHEADER, $header);

//curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_POST, 1);

$result = curl_exec($curl);
if ($result == false) {
throw new Exception("curl_exec threw error \"" . curl_error($curl) . "\" for " . $url . "?" . $postdata );
}
curl_close($curl);

return $result;
}

Error line (2136) file -->xmlapi.php
return $this->xmlapi_query('showbw', $args);

public function showbw($args = null)
{
if (is_array($args)) {
return $this->xmlapi_query('showbw', $args);
}

return $this->xmlapi_query('showbw');
}

public function nvset($key, $value)
{
if (!isset($key) || !isset($value)) {
error_log("nvset requires that key and value are passed to it");

return false;
}

return $this->xmlapi_query('nvset', array('key' => $key, 'value' => $value));
}

Error line (676) file -->xmlapi.php

$response = $this->curl_query($url, $args, $authstr);

$response = NULL;
if ($this->http_client == 'curl') {
$response = $this->curl_query($url, $args, $authstr);
} elseif ($this->http_client == 'fopen') {
$response = $this->fopen_query($url, $args, $authstr);
}

Error line informacao.php(175): xmlapi->showbw()

$xml1 = simplexml_load_string($accounts1);

$accounts1 = $xmlapi->showbw();
$xml1 = simplexml_load_string($accounts1);
$expression1 = sprintf("/*/bandwidth/acct[contains(user, '".$_SESSION["gravaUser"]."')]", $_SESSION["gravaUser"]);
$result1 = $xml1->xpath($expression1);

Was running after this update is not working. Could someone help me

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 AT89C51控制8位八段数码管显示时钟。
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题