php 致命错误:找不到“XSLTProcessor”类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7930726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fatal error: Class 'XSLTProcessor' not found
提问by user478636
I'm using XAMPP Server 1.7.7
我正在使用 XAMPP 服务器 1.7.7
While opening the php file, i receive the error
打开php文件时,我收到错误
Fatal error: Class 'XSLTProcessor'
not found
Fatal error: Class 'XSLTProcessor'
未找到
回答by Berry Langerak
Install the XSL extension to get that class. This might be as easy as uncommenting (remove the starting ';') on the line that reads extension=php_xsl.dll
in php.ini on Windows, or apt-get install php5-xsl
on most Linux-based systems. For custom builds of PHP, use configure option --with-xsl
(requires package libxslt1-dev).
安装 XSL 扩展以获得该类。这可能就像extension=php_xsl.dll
在 Windows 或apt-get install php5-xsl
大多数基于 Linux 的系统上的php.ini 中取消注释(删除开头的“;”)一样简单。对于 PHP 的自定义构建,请使用配置选项--with-xsl
(需要软件包 libxslt1-dev)。
回答by Paulo Victor
Its necessary install the XLS extension.
它有必要安装 XLS 扩展。
My solution by my context.
我的解决方案。
I'm using one docker container contain ubuntu base and using php-fpm (ie if you simply already use linux ubuntu in the same).
我正在使用一个包含 ubuntu 基础的 docker 容器并使用 php-fpm(即,如果您只是已经在其中使用了 linux ubuntu)。
The steps to install this extension in my context were:
在我的上下文中安装此扩展的步骤是:
First search xsl extension on linux repository
sudo apt-cache search xsl
首先在 linux 存储库上搜索 xsl 扩展名
sudo apt-cache search xsl
I ended up finding the php5-xsl, so it was only install
sudo apt-get install php5-xsl
我最终找到了 php5-xsl,所以它只是安装
sudo apt-get install php5-xsl
that the installation process the setup configuration is already added, if does not happen, just make yourself
sudo vim /etc/php5/mods-available/xsl.ini
安装过程中已经添加了setup配置,如果没有,就自己做
sudo vim /etc/php5/mods-available/xsl.ini
insert this content:extension=xsl.so
插入此内容:extension=xsl.so
(obviously the paths are according to your php configuration settings, but my example is the default configuration)
(显然路径是根据你的php配置设置,但我的例子是默认配置)
Restart you php fpm and done (sudo service php5-fpm restart
)!
重新启动你的 php fpm 并完成(sudo service php5-fpm restart
)!