Coinbase API可捕获的致命错误null参数to httpexception :: exceptionClass



在Local主机中,一切正常。但是在实时服务器中,它因致命错误而不会进一步执行。

    /* ======== API CONFIG ========== */
require __DIR__.'/dev_components/wallet_api_components/vendor/autoload.php';
use CoinbaseWalletClient;
use CoinbaseWalletConfiguration;
use CoinbaseWalletResourceAccount;
use CoinbaseWalletResourceAddress;
use CoinbaseWalletResourceTransaction;
use KatzgrauKLoggerLogger;
/* Settings */
$apiKey = "XXXXXXXXXX";
$apiSecret = "YYYYYYYYYYYYYYY";
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$logger = new Logger(__DIR__.'/errorlog', PsrLogLogLevel::WARNING, array (
    'logFormat' => '{date} - {level} - {message}',
    'filename'  => 'error_log',
    'extension' => 'txt'
));
$logger->info('INFO message');
$configuration->setLogger($logger);
$client = Client::create($configuration);
// I have used print_r($configuration) ; print_r($client) to check the full 
//configuration and client object and in both localhost and Live server its 
//showing same data

$account_btc = $client->getAccount('BTC'); // From this line nothing executing
$account_eth = $client->getAccount('ETH');

错误是

stderr:php可捕致命错误:参数1传递给Coinbase Wallet exception httpexception :: exceptionClass((必须是psr http http message message wesponseinterface的实例/coinbase/src/exception/httpexception.php在第33行上,并在/path/path/vendor/coinbase/coinbase/coinbase/src/exception/httpexception.php中定义,第98

在实时服务器中获得上述致命错误的原因是什么?

我在设置Coinbase API时也会收到此错误。此错误是由于SSL证书造成的,因此我从https://curl.se/docs/caextract.html下载了cacert.pem文件,然后将其放入ETC文件夹中。之后,我更改了vert名称&quot" src/configuration.php"在第58行" this-> cabundle = dir 。'/../etc/ca-coinbase.crt'"到" this-> cabundle = dir 。'/../etc/etc/cacert.pem'&quot。因此,我的错误解决了。

我假设您没有发布整个错误转储,但是查看您的错误:stderr: PHP Catchable fatal error: Argument 1 passed to CoinbaseWalletExceptionHttpException::exceptionClass() must be an instance of PsrHttpMessageResponseInterface

这意味着当httpexception:exceptionclass((调用时,您必须使用参数中的响应界面对象调用它。

如果上述内容无法解决您的问题,请发布整个错误转储。如果您不发布整个错误转储,则很难知道根本原因。

相关内容

最新更新