首页 > 解决方案 > 无法仅在 ovh serverurcloud 上连接到服务器

问题描述

我在 OVH (cloudweb) 有一台服务器。我在 symfony 下有一个调用 API 的脚本。

当我在本地测试时,我没有错误,但是当我在服务器上的生产环境中运行脚本时,我遇到了这个错误:

11:40:45 CRITICAL [控制台] 运行命令“'app:check-trans'”时引发错误。消息:“无法连接到“https://api-eu1.tatum.io/v3/ethereum/account/transaction/0xFB0AbEce6D2a9ec6E7Fd2B6CE049EfE88bb07377?pageSize=50”的服务器。” ["exception" => Symfony\Component\HttpClient\Exception\TransportException^ { …},"command" => "'app:check-trans'","message" => "无法连接到服务器 "https ://api-eu1.tatum.io/v3/ethereum/account/transaction/0xFB0AbEce6D2a9ec6E7Fd2B6CE049EfE88bb07377?pageSize=50"."] {"message":"命令 "'app:check-trans'" 以代码 "1" 退出","context":{"command":"'app:check-trans'","code":1},"

在 ErrorChunk.php 第 65 行:

无法连接到“https://api-eu1.tatum.io/v3/ethereum/accoun
t/transaction/0xFB0AbEce6D2a9ec6E7Fd2B6CE049EfE88bb07377?pageSize=50”的服务器。

在 CurlResponse.php 第 317 行:

无法连接到“https://api-eu1.tatum.io/v3/ethereum/accoun
t/transaction/0xFB0AbEce6D2a9ec6E7Fd2B6CE049EfE88bb07377?pageSize=50”的服务器。

这是脚本的一部分:

   public function getTransactionsEth()
   {
       $url = $this->baseUrl . 'ethereum/account/transaction/' . $this->addressEth . '?pageSize=50';
       $response = $this->client->request(
           'GET',
           $url,
           [
           'headers' => [
               'x-api-key' => $this->apiKey,
           ],
       ]);

       $content = $response->getContent();

       return $content;
   }

标签: phpsymfonycurlovh

解决方案


推荐阅读