【发布时间】:2017-10-17 09:38:56
【问题描述】:
我正在使用 Braintree 在我的网站上接受付款。但是当我尝试打开视图进行购买时,我收到了这个错误:
Braintree.php 第 20 行中的异常: Braintree 库需要 xmlwriter 扩展。
这是我的 Braintree.php 文件:
<?php
/**
* Braintree PHP Library
* Creates class_aliases for old class names replaced by PSR-4 Namespaces
*
* @copyright 2015 Braintree, a division of PayPal, Inc.
*/
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php');
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
throw new Braintree_Exception('PHP version >= 5.4.0 required');
}
function requireDependencies() {
$requiredExtensions = ['xmlwriter', 'openssl', 'dom', 'hash', 'curl'];
foreach ($requiredExtensions AS $ext) {
if (!extension_loaded($ext)) {
throw new Braintree_Exception('The Braintree library requires the ' . $ext . ' extension.');
}
}
}
requireDependencies();
我已经检查了 xmlwriter 和 libxml 是否已启用并安装在我的项目中,并且一切都已解决。所以我不知道还能做什么。知道为什么会这样吗?
任何帮助都非常感谢:)
【问题讨论】:
标签: php payment braintree lumen xmlwriter