Braintree PHP所需的版本冲突

时间:2019-05-26 21:37:46

标签: php paypal paypal-sandbox braintree

我正在尝试在服务器上设置服务器端Braintree PHP库。 我从他们提供的链接中下载了Braintree PHP库,并将其解压缩并上传到我的服务器。我创建了一个config.php文件,其中包含服务器上PHP库的路径,并按如下所示定义我的API凭据:

<?php require_once 'btphp/lib/Braintree.php'; Braintree_Configuration::environment('sandbox');Braintree_Configuration::merchantId('yqjkd7r5kdtdyq9d');Braintree_Configuration::publicKey('ssjcrbg3qff8cnk2');Braintree_Configuration::privateKey('6fd935bc49457f318027b52bd262572e');$clientToken = $gateway->clientToken()->generate(["customerId" => $aCustomerId]);?>

在执行该文件时,出现致命错误,指出需要PHP版本7.2。

Fatal error: Uncaught exception 'Braintree\Exception' with message 'PHP version >= 7.2.0 required' in /home/content/37/11957537/html/ua/btphp/lib/Braintree.php:10 Stack trace: #0 /home/content/37/11957537/html/ua/btconfig.php(3): require_once() #1 {main} thrown in /home/content/37/11957537/html/ua/btphp/lib/Braintree.php on line 10

Braintree文档明确声明以下内容:

  

可用性   Braintree PHP SDK需要PHP 5.4.0或更高版本以及PHP cURL扩展名。

我的Web托管PHP版本是5.6

任何人都可以解释为什么会这样。

1 个答案:

答案 0 :(得分:0)

要解决此问题。您需要对它们进行评论,如Braintree.php中的image(9,10,11)行中所示。 enter image description here

这对我有用。

相关问题