showbw()---致命错误:未捕获的异常'异常'消息' curl_exec抛出错误"

时间:2015-06-16 15:56:19

标签: php cpanel cpanel-xmlapi

我昨天更新了我的WHM 11.50.0.10,我使用Xmlapi API来管理我的账单,给错误带(Traffic)使用showbw()函数。 我不知道现在发生了什么不再有效。看错误!

  

致命错误:未捕获的异常'异常'消息' curl_exec抛出错误""对于https://000.000.000.00:2087/xml-api/showbw?'在/home/controle/public_html/conseld/Servidor/xmlapi.php:759堆栈跟踪:#0 /home/controle/public_html/conseld/Servidor/xmlapi.php(676):xmlapi-> curl_query(' https://000.000 ...','','授权:...')#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 /...')#home {contr} / home / controle / public_html第7行的/conseld/Servidor/xmlapi.php

错误行(759)文件 - > 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\r\n" .
"Content-Length: " . strlen($postdata) . "\r\n" . "\r\n" . $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));
}

错误行(676)文件 - > 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);
}

错误行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);

此更新无法运行后正在运行。有人可以帮助我

0 个答案:

没有答案