致命错误:Class' XSLTProcessor'没找到 - 但已安装

时间:2016-05-17 15:09:40

标签: php azure xslt php-extension

尝试执行以下操作时

$xsl = new XSLTProcessor();

我收到此错误

  

致命错误:Class' XSLTProcessor'

中找不到

我已经看过this question about this exact same error(和this one),但我认为这是不同的。我是否正确地说(我已经测试过并且看起来像是)因为扩展细节显示在phpinfo()中它确实安装正确吗?

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

是这种情况,还是总是会在phpinfo()中显示,无论它是否成功安装?如果安装成功,您知道可能导致错误的原因吗?

我已经尝试了几个版本的PHP,并且值得我在Azure上托管并拥有followed and checked the instructions here,这进一步让我相信扩展程序已正确安装。

1 个答案:

答案 0 :(得分:2)

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

但是,Azure Web Apps已在每个可用版本的PHP运行时的php_xsl.dll文件夹中包含ext库。但默认情况下,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

如有任何疑问,请随时告诉我。