Braintree 在本地工作,而不是在服务器上工作

Braintree working on local, not on Server

调用 Braintree_ClientToken::generate() 时出现错误;在 Slim Framework api 调用中看起来像

$app->get('/api/getClientToken', function() use ($dbh){
//$clientToken = "myToken";
  Braintree_ClientToken::generate();
  echo json_encode($clientToken);

此错误仅发生在我的亚马逊网络服务器上(它是 POST 服务器 500 错误)。当我在我的本地设置上调用 api 时,调用 returns 我的客户端令牌很好。

我在 api 调用之前调用了这些函数(在我的 start.php 文件中)

  Braintree_Configuration::environment('sandbox');
  Braintree_Configuration::merchantId('--');
  Braintree_Configuration::publicKey('--');
  Braintree_Configuration::privateKey('--');

似乎没有安装 cURL。

运行 sudo apt-get install php5-curl 然后重启 Apache。