Monday 2 September 2013

How to install php-pecl-solr on Centos

You can download php-pecl-solr from this link https://github.com/ecaron/php-pecl-solr and Extract that file.

           [root@manivel ]# unzip php-pecl-solr-master.zip

Go to php-pecl-solr-master directory

           [root@manivel ]# cd php-pecl-solr-master/

You need to install some package before install the php-pecl-solr

           [root@manivel ]# yum install curl curl-devel
           [root@manivel ]# yum install libxml2-devel
          [root@manivel ]# yum install php-devel

The phpize command is used to prepare the build environment for a PHP Extension

          [root@manivel php-pecl-solr-master]# phpize 
          Configuring for:
          PHP Api Version:         20090626
          Zend Module Api No:      20090626
          Zend Extension Api No:   220090626

 Run these command to compile and install the php-pecl-solr

          [root@manivel php-pecl-solr-master]# ./configure 

          [root@manivel php-pecl-solr-master]# make 

          [root@manivel php-pecl-solr-master]# make install

A successful install will have created solr.so and You need to add extension=solr.so in php.ini file

         [root@manivel php-pecl-solr-master]# vi /etc/php.ini

               extension=solr.so

           :wq

After that restart the httpd service

          [root@manivel php-pecl-solr-master]# service httpd restart

I hope and it helps.....

No comments:

Post a Comment