You can find what Solr is exactly at http://lucene.apache.org/solr/#intro if you don’t know already. I’m gonna tell you how to compile it yourself:

If you have given an error about PHP version you need to change version controller to your current PHP version in php_solr.c (For example, I changed it to 5.2.6) The developer asks for 5.2.11 version but I have no idea why. I asked him about that but no answer yet. If anything comes up I’ll update this post immediately.

First of all, download the source from here.

apt-get install libcurl4-openssl-dev
apt-get install libxml2-dev
phpize
./configure
make install