build php solr extension on ubuntu linux

Step By Step on Ubutnu 10.04

You will need the php5 development package:

sudo aptitude install php5-dev

Then you will need the php5-solr package found at the pecl solr page I downloaded the 1.0.2 release. I tried to build it but the system is kind to inform me that I'm missing the development files for curl and libxml, so they have to be installed.

sudo aptitude install libxml2-dev libcurl-dev

Depending on your system these two packages may be called something different. On Unbuntu 11.04 you will need: libcurl4-openssl-dev

then decompress, build and install the pecl solr package

tar xvfz solr-1.0.2.tgz
cd ./solr-1.0.2
sudo make install

You have now build the extension. Next thing to do is notify php that you have a new extension that you like to enable:

Finnally create and edit the following file:

sudo vim /etc/php5/apache2/conf.d/solr.ini 

And add the following line:

Then you will need to restart apache2:

sudo service apache2 reststart

Shell Script Install for Ubuntu 11.04

On Ubuntu 11.04 you can also run this script straight away:

aptitude install libxml2-dev libcurl4-openssl-dev php5-dev
tar xvfz solr-1.0.2.tgz
cd ./solr-1.0.2
make install
echo "Creating config file for solr\n"
echo "" > /etc/php5/apache2/conf.d/solr.ini
service apache2 restart

Save as e.g, and execute

sudo ./

This page has been viewed 4232 times. First hit: 30-Oct-2015 14:49:02
Share email, Google+, Twitter, Facebook.
comments powered by Disqus