php - fatal error : Class 'XSLTProcessor' not found - but is installed

标签 php azure xslt php-extension

当尝试执行以下操作时

$xsl = new XSLTProcessor();

我收到此错误

Fatal error: Class 'XSLTProcessor' not found in

我见过this question about this exact same error (和 this one )但我认为这是不同的。我是否正确地说(我已经测试过它并且似乎是)因为扩展详细信息显示在 phpinfo() 中,所以它确实安装正确?

enter image description here enter image description here enter image description here

是这样吗,或者无论安装成功,它总是显示在 phpinfo() 中吗?您知道安装成功后可能会出现什么错误吗?

我已经尝试了 PHP 的多个版本,但出于其值(value),我托管在 Azure 上并拥有 followed and checked the instructions here这进一步让我相信扩展已正确安装。

最佳答案

您如何启用 php_xsl Azure 上的扩展?如果您手动将 DLL 库上传到 Azure 并通过 How to: Enable extensions in the default PHP runtime通过 ini 设置配置部分进行配置。可能是您配置的DLL库与PHP版本或操作系统版本不匹配。

但是,Azure Web Apps 已包含 php_xsl.dll图书馆在 ext每个可用版本中 PHP 运行时的文件夹。但默认情况下 Azure PHP 运行时不会启用它。您可以登录Azure Web App服务的Kudu控制台站点,并直接进入默认的ext文件夹,例如 D:\Program Files (x86)\PHP\v7.0\ext 。您可以找到Azure提供的所有库。

因此,请删除您的旧配置,并尝试按照How to: Enable extensions in the default PHP runtime通过ini设置配置部分进行操作。 ,添加extensions.ini中的配置:

extension=php_xsl.dll

如有任何进一步的疑虑,请随时告诉我。

关于php - fatal error : Class 'XSLTProcessor' not found - but is installed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37279971/

相关文章:

php - (Swift,iOS)根据 PHP 脚本中使用的 POST 变量从 mySQL 数据库解析 JSON 对象?

一个月之间的 PHP MySQL SUM

php 左加入 请帮忙

c - Azure IoT - 重置和清除设备孪生

xml - 使用 XSLT 从 XML 中选择数据?

php - 保护可购买的下载链接

Azure 服务总线死信队列

Azure数据工厂: Access token from MSI failed for Data Factory

javascript - 对 <xsl :template> 中的 <div> 的引用

xslt 转换返回空白值