Saxon C was built having this (PHP) use case in mind. This is a Saxon XSLT 2.0 processor and now it can be used from PHP.
More specifically, here is the information from the documentation on how to build the PHP extension:
PHP extension
To build the PHP extension follow the steps below.
(Alternatively, you may like to use the installation script install.sh
supplied by Petr Zak - written for a 64-bit machine, but can be
changed for a 32-bit machine.)
Run the commands:
• phpize
• ./configure --enable-saxon
• make
• sudo make
install
Update the php.ini file (if using Ubuntu it is usually in the location
'/etc/php5/apache2/') to contain the PHP extension. Insert the
following in the Dynamic Extensions section: extension=saxon.so, then
run the command
• sudo service apache2 restart