我正在尝试在 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/