John
John

Reputation: 1319

php XSLTProcessor generates server 500 error

I am trying to run a xslt process:

$xslt = new XSLTProcessor(); 

Pretty standard, however I am a bit miffed as it is generating a server 500 error, I have attempted to locate the PHP error log to no avail, and checked through the httpd error log so which I see no error relating to this issue.

I am currently running a Centos v6 64bit OS with PHP 5.3.3 (latest) installed, I have done a yum install of php-xml as php-xsl does not exist and I am wondering if anyone else out there can shed any light into why this is dieing when on my local windows machine it is happy days!

Upvotes: 0

Views: 779

Answers (1)

MatsLindh
MatsLindh

Reputation: 52792

Error 500 indicates a parse error or another fatal error, so my first guess is that the XSLTProcessor class is missing (the XSL module hasn't been loaded). Be sure that xsl.so has been added as a loaded extension (extension=xsl.so) and that it was installed together with the xml modules (it should be - as far as I can see it lives in the php-xml for Centos).

Do a phpinfo() call, and see if xsl / xml is available there. Check the value of error_log to see where specific PHP errors are logged, verify that error_reporting is not set to E_NONE / 0 and be sure that log_errors is turned on (if it isn't, you won't see any errors in the error log or the php log).

If you're still no wiser, simply try to do var_dump(class_exists("XSLTProcessor")) to see if the class is available at all.

While this is not the exact answer for what you need to do, it should provide you with enough information to find out what's wrong from the information you've provided.

Upvotes: 3

Related Questions