這里寫問題描述
我有三個系統(tǒng),A,B系統(tǒng)都是centos系統(tǒng) C是Debian 系統(tǒng)
我三個系統(tǒng)都是使用的webman 代碼都是一樣的 使用http-clicent 訪問第三方接口。A,B 接口都可以正常訪問。只有這個接口請求顯示超時
clicent 代碼如下
$client->get('http://apilocate.amap.com/position?accesstype=0&imei=' . $imei . '&cdma=0&bts=' . $bts . '&serverip=' . $serverip . '&output=json&key=5', function ($response) use ($Hardwaredata, $Softwaredata,$returnvalue,$newbts) {
$receivedata = $response->getBody();
$data = json_decode($receivedata, true);
}, function ($exception) {
print_r($exception);
});
超時打印如下
Exception Object
(
[message:protected] => connect apilocate.amap.com:80 timeout after 30 seconds
[string:Exception:private] =>
[code:protected] => 1
[file:protected] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/http-client/src/Request.php
[line:protected] => 461
[trace:Exception:private] => Array
(
[0] => Array
(
[function] => onError
[class] => Workerman\Http\Request
[type] => ->
)
[1] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/http-client/src/ConnectionPool.php
[line] => 172
[function] => call_user_func
)
[2] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/workerman/Events/Event.php
[line] => 167
[function] => closeTimeoutConnection
[class] => Workerman\Http\ConnectionPool
[type] => ->
)
[3] => Array
(
[function] => timerCallback
[class] => Workerman\Events\Event
[type] => ->
)
[4] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/workerman/Events/Event.php
[line] => 193
[function] => loop
[class] => EventBase
[type] => ->
)
[5] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/workerman/Worker.php
[line] => 1638
[function] => loop
[class] => Workerman\Events\Event
[type] => ->
)
[6] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/workerman/Worker.php
[line] => 1429
[function] => forkOneWorkerForLinux
[class] => Workerman\Worker
[type] => ::
)
[7] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/workerman/Worker.php
[line] => 1403
[function] => forkWorkersForLinux
[class] => Workerman\Worker
[type] => ::
)
[8] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/workerman/Worker.php
[line] => 560
[function] => forkWorkers
[class] => Workerman\Worker
[type] => ::
)
[9] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/vendor/workerman/webman-framework/src/support/App.php
[line] => 131
[function] => runAll
[class] => Workerman\Worker
[type] => ::
)
[10] => Array
(
[file] => /www/wwwroot/webmanjson.cnsmarto.com/start.php
[line] => 4
[function] => run
[class] => support\App
[type] => ::
)
)
[previous:Exception:private] =>
)
通過阿里云服務器的網(wǎng)絡(luò)自查,重啟好可以了