Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/' - /usr/lib/php5/20100525/ 
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

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 ...
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 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?

share|improve this question
up vote 4 down vote accepted

OK, I found the answer myself. Problem was in the errors in configuration. On newest Wheezy the config tree for PHP is as follows:

/etc/php5/mods-available/*.ini # here's the ini files containing `` lines and module-specific config.
         /conf.d/NN-*.ini      # here's the symlinks to real .ini files in mods-available
         /cli/conf.d           # symlink from local CLI conf.d to global conf.d 
         /apache/conf.d        # symlink from local apache conf.d to global conf.d

So I needed to do the following things:

  • Add a file /etc/php5/mods-available/solr.ini with the line ""
  • Add a symlink /etc/php5/conf.d/30-solr.ini pointing to real solr.ini
  • Do the same thing to
  • Ensure that the "" and "" 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.

share|improve this answer

I was having the same problem with the same error.

FWIW - What worked for me was moving "" from the top of my php.ini file to the bottom - obviously order is important and the curl extension need to be pulled in first.

Hope it helps someone.

share|improve this answer
Yeah, basically, all this work with separating of to several distinct files in /etc/php5/conf.d/NN-XXX.ini is about it: to ease the management of loading all this extensions. – hijarian Jan 11 '13 at 16:30

For anyone under CentOS 6.4, this did it for me. Thanks to hijarian, this is an adaptation of his answer.

After installing everything and compiling the extension make a new solr.ini file under /etc/php.d

Using nano, for instance: nano /etc/php.d/solr.ini

Add a line to that file containing, save and exit.

Open /usr/php.ini file and add to it also, save and exit.

Restart apache...

/etc/init.d/httpd restart

and you should be all done!

share|improve this answer

curl module must be loaded BEFORE solr module. So, make shure you have something like this in conf.d : 20-curl.ini 30-solr.ini (and not 10-solr.ini)

Or juste add "" after your ""

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.