Question

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 install php5_xsl
  • edit php.ini file and add extension=php5_xsl.so
  • restart apache

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.

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

Was it helpful?

Solution

Try this:

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

Why:

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top