Help and How-tos JSolr Installing Apache Solr PHP extension

Installing Apache Solr PHP extension

This how-to only covers the installation of a PECL extension and assumes you have already installed and configured PEAR, PHP's Extension and Application Repository software and that you know how to install an extension using PECL, PHP's Extension Community Library.

JSolr runs on the Solr PECL extension. Therefore, you will need to install this PHP library in order for JSolr to function.

On Linux and other *nix-based systems

There are two ways to install the Solr PECL library on *nix systems:

  1. Using the pecl command,
  2. Configuring and installing it manually.

Using the pecl command

Install the latest version of Solr PECL library:

sudo pecl install -n solr-beta

Manual Installation

Ensure you have phpize and php curl installed.

Download the Solr PECL tar gz file and extract it:

wget http://pecl.php.net/get/solr-0.9.11.tgz
tar -xvf solr-0.9.11.tgz

Build Solr and install it:

cd solr-0.9.11
phpize
./configure
make
make install

You will probably also need to configure PHP to recognize the solr.so file. To do this, add the following line to your PHP configuration: extension=solr.so.

Ubuntu/Debian Installation

The following is an list of steps to install the Solr PECL library onto a Debian-based Linux distribution:

sudo apt-get install php5-curl
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libxml2
sudo apt-get install libxml2-dev
sudo pecl install -n solr-beta
sudo vi /etc/php5/conf.d/solr.ini
Add the following line to your solr.ini file:
extension=solr.so

On Windows (Not tested)

As with any enterprise-level software, it is not recommended that you install JSolr on Windows in a production environment. Therefore, we are unable to assist any Windows users with any problems they may encounter whilst installing these libraries. If you are a Windows user looking for assistance, we recommend you post a message to our Joomla Code forum (http://joomlacode.org/gf/project/jsolr/forum/?action=ForumBrowse&forum_id=15150). We do not actively respond to Windows related issues.

Solr DLLs are available at http://downloads.php.net/pierre/.

Once downloaded, extract it to your computer and then configure PHP to reference it:

extension=php_solr.dll

Also ensure you have the correct libxml2 and libcurl DLLs installed also (http://www.php.net/manual/en/solr.requirements.php).