I'm trying to use the Solr PHP extension on the recently-upgraded Debian Wheezy. It installs both from PECL and from sources flawlessly but instead of giving me expected functionality it gives me this on every PHP run:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20100525/solr.so' - /usr/lib/php5/20100525/solr.so:
undefined symbol: curl_easy_getinfo in Unknown on line 0
Also scripts which use the extension throws an error
PHP Error[2]: include(SolrClient.php): failed to open stream:
No such file or directory in file <...path to my autoloader...>
My main point is that it was set up before and worked like a charm. In the upgrade among the relevant packages only the versions of PHP and libcurl was changed. Instance of Solr itself was left as is.
I have all possible libcurl
libraries:
$ locate libcurl
...
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0
/usr/lib/x86_64-linux-gnu/libcurl.a
/usr/lib/x86_64-linux-gnu/libcurl.la
/usr/lib/x86_64-linux-gnu/libcurl.so
/usr/lib/x86_64-linux-gnu/libcurl.so.3
/usr/lib/x86_64-linux-gnu/libcurl.so.4
/usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
...
/usr/lib32/libcurl.so.3
/usr/lib32/libcurl.so.4
/usr/lib32/libcurl.so.4.2.0
...
I have instaled the php5-curl
package version 5.4.4-2 with aptitude.
I installed the Sorl extensions both with
sudo pecl install solr
(with various combinations of -f
and -n
flags and tried solr-beta
too) and with
wget ...
cd ...
phpize
./configure
make
make install
I'm installing the 1.0.2 version of extension because it worked before the upgrade from Squeeze to Wheezy. As I said earlier, extension installs without any errors.
I have already added the extension=solr.so
incantation to the /etc/php5/mods-available/solr.ini
What magic should I do to make solr extension work? Is this true that the only solution that I have is to downgrade the libcurl version as it was before the upgrade?
Best Answer
OK, I found the answer myself. Problem was in the errors in configuration. On newest Wheezy the config tree for PHP is as follows:
So I needed to do the following things:
/etc/php5/mods-available/solr.ini
with the line"extension=solr.so"
/etc/php5/conf.d/30-solr.ini
pointing to real solr.inicurl.so
"extension=solr.so"
and"extension=curl.so"
is not written anywhere else. That was the cause of this strange error message.I think that the config become messy because of recent upgrade from Squeeze to Wheezy, because all of this configuration set-up should be really done by the package manager.