3

I have been attempting to install the PHP Solr extension onto a Windows test server. I have gone ahead and added the extension to the php.ini and moved the .dll to the ext directory. However upon restarting, Apache just does not want to load and my error log contains this:

PHP Warning: PHP Startup: Unable to load dynamic library 'D:\xampp\php\ext\php_solr.dll' - The specified module could not be found.\r\n in Unknown on line 0

My PHP version is 5.3.1 if it helps. Has anyone else experienced this error

Spencaroo
  • 95
  • 6
  • possible duplicate of [Error In PHP5 ..Unable to load dynamic library](http://stackoverflow.com/questions/10565521/error-in-php5-unable-to-load-dynamic-library) – kenorb May 19 '15 at 11:21
  • Did you get the correct 5.3 compatible version from http://pecl.php.net/package/solr/2.4.0/windows? Even tho that question is 2 years old :-) – Capsule May 11 '17 at 02:54
  • 1
    @cytsunny You would need to make sure that library you use is compiled for proper version of PHP. With proper compiler. – E_p May 15 '17 at 23:01
  • @E_p You got the point. I got the wrong version. How misleading it is to say that the file is not found..... I got the name right, it should say something like fail to compile. Mind if you turn your comment into answer so I can award you? – cytsunny May 16 '17 at 04:21
  • @cytsunny Done. – E_p May 16 '17 at 04:40

2 Answers2

0

Generally this error will come when extension file or path doesn't exist or the permissions are incorrect.

Look for extension_dir in your php.ini & make sure extension path is correct & proper permission is set.

rajatsaurastri
  • 653
  • 3
  • 21
0

All PHP extensions are compiled for the specific version of PHP. PHP API is versioned differently for different versions of PHP. In some cases even compiler version meter(Windows environment).

It is way easier for Linux as packages would have properly compiled versions bundled with both PHP and extensions.

So, unless you are compiling PHP and extensions yourself you need to check what version it is compiled for.

PS: If you have all build tools installed and a pecl you can use it to manage extensions for you.(Though it just compiles it for you)

E_p
  • 3,136
  • 16
  • 28