XMLWriter 未加载到 braintree 中

XMLWriter is not loading in braintree

我正在使用 braintree 在我的网站上接受付款。但是,当我尝试打开一个视图进行购买时,出现此错误:

Exception in Braintree.php line 20: The Braintree library requires the xmlwriter extension.

这是我的 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 已启用并安装在我的项目中,一切都已准备就绪。所以我不知道还能做什么。知道为什么会这样吗?

非常感谢任何帮助:)

首先,确保安装了 XMLWriter PHP 模块

sudo apt-get update

sudo apt-get install php7.0-xml

php -i | grep "xml"

这应该显示行 xmlwriter

检查你的错误日志sudo cat /var/log/nginx/error.log

如果有任何错误 failed to open stream,请检查您的路径是否正确。

错误消息应该会给您更多指导。