sudo su
Install dependencies:
apt-get install libxml2-dev libcurl4-openssl-dev
Install by pear
pear install pecl/solr
Or compile from source
cd /opt
wget http://pecl.php.net/get/solr-1.0.2.tgz
tar -xvf solr-1.0.2.tgz && cd solr-1.0.2
./configure
make
make install