在 Ubuntu 12.04 上启用 XSL [英] Enable XSL on Ubuntu 12.04

查看:39
本文介绍了在 Ubuntu 12.04 上启用 XSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to enable XSL on Ubuntu 12.04 but its failing. I did this locally on my Ubuntu 13.04 and it was successful. Basically the following worked on my local computer.

  • 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 因为这是扩展目录中的内容.

I repeated the same procedures on my production server running Ubuntu 12.04 and PHP version 5.5.12 but the extension is not getting loaded from the phpinfo. I have also changed the extension=php5_xsl.so to extension=xsl.so because this is what in the extension directory.

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

I read that I might need to recompile PHP but I am not sure of this steps.

推荐答案

试试这个:

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

这里发生的事情是所有 debian 风格的 unix 都采用了这个标准适用于他们的 PHP 5.4 包,所以如果你使用的是 debian,ubuntu 或任何他们的 PHP 5.4 亲戚,你会看到一个目录这样的结构.当您向 PHP 添加模块时,您将添加一个文件到 mods-available 目录启用模块并添加任何特定于它的配置.如果您想启用该模块,只需执行以下操作:

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

这只是从通常的 conf.d 目录创建一个符号链接指向到真实文件在 mods-available 中的位置,以数字为前缀表示模块的优先级.默认情况下,优先级为20.

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.

使用这种方法意味着我们可以在不注释掉大块的配置文件并让它们撒谎周围 - 如果这看起来很熟悉,那就不足为奇了;类似debianlinux 以同样的方式管理他们的 apache 配置.任何您使用 aptitude 安装的软件包将使用这些完全相同的命令来设置配置,然后正确地对其进行符号链接.到取消链接,使用令人愉快的可预测名称 php5dismod :)

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 :)

这篇关于在 Ubuntu 12.04 上启用 XSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆