php - 在 Ubuntu 12.04 上启用 XSL

标签 php xml xslt ubuntu

我正在尝试在 Ubuntu 12.04 上启用 XSL,但失败了。我在我的 Ubuntu 13.04 上本地做了这个并且成功了。基本上以下在我的本地计算机上工作。

  • apt-get 安装 php5_xsl
  • 编辑php.ini文件并添加extension=php5_xsl.so
  • 重启apache

我在运行 Ubuntu 12.04 和 PHP 5.5.12 版的生产服务器上重复了相同的过程,但扩展没有从 phpinfo 加载。我还将 extension=php5_xsl.so 更改为 extension=xsl.so 因为这是扩展目录中的内容。

我读到我可能需要重新编译 PHP,但我不确定这个步骤。

最佳答案

试试这个:

sudo apt-get install php5-xsl
sudo php5enmod xsl
sudo service apache2 restart

原因:

http://www.lornajane.net/posts/2012/managing-php-5-4-extensions-on-ubuntu

What's happened here is that all debian-flavoured unixes have adopted this standard for their PHP 5.4 packages, so if you're using debian, ubuntu, or any of their relatives with PHP 5.4, you'll see a directory structure like this. When you add a module to PHP, you'll add a file to the mods-available directory enabling the module and adding any config specific to it. If you want to enable the module, just do:

php5enmod http

This simply creates a symlink from the usual conf.d directory to point to where the real files are in mods-available, prefixed with a number that indicates the priority of the module. By default, the priority is 20.

Using this approach means we can toggle things on and off without commenting out big chunks of config files and leaving them lying around - if this seems familiar then that's no surprise; debian-like linuxes manage their apache configuration in just the same way. Any packages that you install using aptitude will use these exact same commands to set up the configuration and then symlink it correctly. To unlink, use the delightfully predictably-named php5dismod :)

关于php - 在 Ubuntu 12.04 上启用 XSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23676127/

相关文章:

php - 如何通过 curl 或任何方法设置跨域 cookie?

javascript - <base> 并链接到一个 ID

android - 即使在为 TabLayout 创建样式后,也会发生错误膨胀类 android.support.design.widget.TabLayout

xml - XSLT + 用转义序列替换双引号

xml - SOAP 响应中的 XPath 查询有什么问题

php - 相互检查两个单独的表 - Mysqli/PHP

xml转换

html - 使用 Symfony DOM Crawler 从 HTML 标签中提取文本值的最有效/最好的方法是什么?

xml - 无法更新 XML 文档的命名空间

php - 通过 PHP 更改 Mysql 数据库中的值