加载资源:braintree js php集成aws ec2灯栈失败


Failed to load resource: braintree js php integration aws ec2 lamp stack

我需要一些帮助与我的JS PHP Braintree集成,使用AWS EC2。

我已经在我的composer.json中使用require包含了braintree PHP库 { "require" : { "braintree/braintree_php" : "3.5.0" } }

和我已经安装它使用run php composer.phar install

这些是我从Braintree提供的一些示例文件,我可以在我的本地计算机上使用Dreamweaver上的脚本。但是当我把文件上传到我的实例时,什么也没有显示。

当我检查我的google chrome日志时,我得到错误消息:"加载资源失败:服务器响应的状态为500(内部服务器错误)"

任何帮助都将是非常感激的。

 <?php
require_once '/home/ec2-user/vendor/braintree/braintree_php/lib/Braintree.php';
require_once '/home/ec2-user/vendor/autoload.php';
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('test_marchant_id');
Braintree_Configuration::publicKey('test_public_key');
Braintree_Configuration::privateKey('test_private_key');
$clientToken = Braintree_ClientToken::generate();
?>
<head>
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
</head>
<html>
<body>
<form id="checkout" method="post" action="server.php">
 <div id="dropin"></div>
  Amount:<input type="text" name="amount"><br>
  First Name:<input type="text" name="firstname"><br>
  Last Name:<input type="text" name="lastname"><br>
  Email:<input type="text" name="email"><br>
  <input type="submit" value="Submit Payment">
    </form>
<script language='javascript'>
braintree.setup("<?php echo $clientToken; ?>", 'dropin', {
 container: 'dropin'
 });
</script>
</body>
</html>

我只是删除了require autoload.php语句,网关就可以完美地处理支付了!