I just can not connect using XSLT on localhost. In a php file when creating an instance of a class

$xsl = new XSLTProcessor(); 

gives an error message:

 Class 'XSLTProcessor' not found 

At the same time, php_xsl.dll is located in \ usr \ local \ php5 \ ext \ (Denwer costs, PHP version 5.3.3, windows 7); everything is allowed in php.ini:

 extension=php_xsl.dll 

I tried, it seems, all the possible options - it still does not work. Probably something still did not take into account. What could be the problem? And - in windows / system32 / should be placed copies of the .dll or not?


UPD:
Suddenly I got the idea to check the release date of php_xsl.dll. It turned out that the library is very old, most likely it was created BEFORE the release of PHP version 5. I downloaded a new one. Placed in directories with extensions. However, apache at startup states that:

PHP Startup: unable to load dynamic library '/user/local/php5/ext/php_xsl.dll'

... although she is there, of course. What can this mean? What library is broken? It seems to me that the problem is in something else ... and also, if it is significant, also reports:

Entry point to xmlNewDocPI procedure not found in libxml2.dll

  • server restarted? - iamsalnikov

2 answers 2

The first way:

1) Look at the value of the Configuration File (php.ini) Path directive in the information that the phpinfo () function will give out and drop the necessary dll into this directory. Restart Denver.

2) In this case, the line in php.ini should look like this:

 extension=php_xsl.dll 

The second way:

1) Check the value of the Loaded Configuration File directive in the information output by the phpinfo () function. There should be a path to the file that is used when loading the PHP interpreter.

2) In the file that is specified in the value of the Loaded Configuration File directive, list the absolute address to php_xsl.dll. Since Denwer is installed in some place on your disk (for example, C: / Program Files / Denwer), the php_xsl.dll connection line in php.ini in this case should look something like this:

Example:

 extension=c:/program files/denwer/usr/local/ext/php5/php_xsl.dll 

3) Restart Denver.

    There are a lot of tips on how to fix php.ini on the Internet for everything to work, but in reality the problem is somewhat more complicated. Mainly due to the fact that not every .dll is suitable for a particular version of Windows installed on a computer, which few people mention. In this case, the reason was precisely this. Find the right version of php_xsl.dll (like other libraries) here: http://windows.php.net/downloads/releases/archives/ This is well written in this article: http://webhybrid.ru/prog/php / xslt-processor . But what is not written there is how to find out which of the proposed libraries really does fit. For my 5.3 version of php, in particular, offered as many as 9 options:

     • php-5.3.3-nts-Win32-VC6-x86.msi • php-5.3.3-nts-Win32-VC6-x86.zip • php-5.3.3-nts-Win32-VC9-x86.msi • php-5.3.3-nts-Win32-VC9-x86.zip • php-5.3.3-src.zip • php-5.3.3-Win32-VC6-x86.msi • php-5.3.3-Win32-VC6-x86.zip • php-5.3.3-Win32-VC9-x86.msi • php-5.3.3-Win32-VC9-x86.zip 

    Let's see which one to choose by analyzing the names. php-5.3.3 - everything is clear

     • Win32 - подойдёт и 32-х, и к 64-х разрядной версии • VC-6/9 - версия компилятора Windows для PHP. 

    The last parameter can be found in the phpinfo.php server (if you have Denwer, http: //localhost/phpinfo.php). See the PHP Extension Build or Zend Extension Build option. After the necessary option is downloaded, open the ext folder in the resulting archive and copy the libraries to the Apache directory. Then everything, as usual - check php.ini, restart the server. I hope to help everyone who is faced with a similar problem.