To find out which libraries you need for performing server-side XSL transformations, you need to determine which PHP version is currently running on your web server. To do that, follow these steps:
Inside the body tag, type the following line of code:
<?php phpinfo() ?>
In your browser, this function will display detailed information about the current PHP installation and settings, modules, libraries, and so on.
Load the page in your browser, to see the results, using F12 (Windows) or Option + F12 (Macintosh). The browser displays a page similar to the following figure:
Figure 1. Viewing details about your current PHP installation
Note: On some systems, the phpinfo() function is disabled for security reasons. In this case, you will receive a warning that this function doesn’t exist or your browser will display a white page. You'll have to remove this function from the disable_functions list in the php.ini file or ask your system administrator to do it.
The PHP version is listed on top of the page. Depending on your current PHP version, you need the following XML/XSL libraries:
In the next section, you will learn how to check if your server already has these libraries installed and configured.
On the same page that you have created and loaded in the browser previously, test.php, look for these settings, depending on your PHP version:
For PHP 5:
For PHP 4.3+:
For PHP 4.2:
If these settings are marked as enabled or active, then you have what you need to process XML documents on the server.
Note: For libxml, libxslt, and Expat, only the version number may be listed (instead of the enabled/disabled status); this indicates they are present on your server.
If any of these libraries are missing or are disabled on your server, then your server is not configured to enable XSL. If you usually dive head-first into your projects and don't like to spend time configuring your server, you might have already encountered this error:
MM_XSLTransform error. The server could not perform the XSL transformation because an XSLT processor for PHP could not be found. Contact your server administrator and ask them to install an XSLT processor for PHP.
The error is displayed on the dynamic page where you have applied the XSL Transformation server behavior in Dreamweaver 8, as you can see in the following figure:
Figure 2. XSL Transformation warning error
The error message is an indication that your server does not have the required XML/XSL libraries.
To learn how to apply the XSL Transformation server behavior, see the section, Applying a Server-Side XSL Transformation to the RSS Feed, in my previous article.
In general, PHP servers require two components to enable XSL:
These two components may vary, according to your current PHP version and may also have other prerequisite modules. Go to the next section to find how to install what you need.