关于:Debian 11系统 使用http-client 问题(已解决)

shanyi

问题描述

这里写问题描述
我有三个系统,A,B系统都是centos系统 C是Debian 系统
我三个系统都是使用的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] => 
)

通过阿里云服务器的网络自查,重启好可以了
截图

336 1 0
1个回答

Tinywan

这个操作系统没关系吧!是不是你服务器相关防火墙端口没开

  • 暂无评论
×
🔝