How to fix PHP Fatal error: Class XSLTProcessor not found

Generating Random String Using PHP

Solution for PHP Fatal error: Uncaught Error: Class ‘XSLTProcessor’ not found is very simple, the main issue is PHP XSL module is missing on your server:

Install the XSL extension for your relevant PHP Version 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).

The steps to install this extension in my context were:

First search xsl extension on linux repository

sudo apt-cache search xsl

I ended up finding the php5-xsl, so it was only install

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

insert this content:

extension=xsl.so

(obviously the paths are according to your php configuration settings, but my example is the default configuration)

Restart you php fpm and done!

sudo service php5-fpm restart

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *