• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / PHP: Class XsltProcessor not found

PHP: Class XsltProcessor not found

A PHP install on Debian 5 by default does not include the Xslt extension which means the following error will occur if trying to use the XsltProcessor class: ” Fatal error: Class ‘XsltProcessor’ not found…”. This post shows how to install the extension on Debian 5.

The error message

If you run the following code:

$xslt = new XsltProcessor();

and get the following error message:

Fatal error: Class 'XsltProcessor' not found in /path/to/script.php on line XYZ

then then XSLT extension is not installed.

Install the XSLT extension on Debian

Run the following command, ether as root or using sudo:

apt-get install php5-xsl

You’ll see some stuff along the lines of this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  php5-xsl
0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 12.8kB of archives.
After this operation, 81.9kB of additional disk space will be used.
Get:1 http://ftp.nz.debian.org lenny/main php5-xsl 5.2.6.dfsg.1-1+lenny3 [12.8kB]
Fetched 12.8kB in 0s (47.4kB/s)
Selecting previously deselected package php5-xsl.
(Reading database ... 48949 files and directories currently installed.)
Unpacking php5-xsl (from .../php5-xsl_5.2.6.dfsg.1-1+lenny3_i386.deb) ...
Setting up php5-xsl (5.2.6.dfsg.1-1+lenny3) ...

At which point it is installed. Apache still needs to be reloaded in order to get access to the extension’s functions, and this can be done with a graceful restart like so, again running the command either as root or using sudo:

/usr/sbin/apache2ctl graceful

Check Out These Related posts:

  1. Install PHP without Apache on Debian
  2. Install PHP IMAP on Debian
  3. Fix the “call to undefined function ImageCreateFromPNG” error in PHP on Debian
  4. Fix the “call to undefined function curl_init” error in PHP on Debian

Filed Under: PHP

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap