How to Install PECL Library in shared server?

Most of us don’t have installation access in all LAMP based shared server.
In this Open source world you never know which function and which code you have to use.
Recently I have encountered one php function which was really important for me to post something from one server to another.
That was  http_post_fields() which is available  in  pecl_http php extension.
pecl_http php extension is used to provide a convenient and powerful set of functionality for most of PHP’s applications, like HTTP urls, dates, redirects, headers and messages etc.
After spending so many hours I figured out how to install and make it work.
I would be happy if you can utilize my hard work and install your own without any paid help!

These are the Steps
1. Download directly in you server for example html folder or wherever you want to install.

wget http://pecl.php.net/get/pecl_http-1.6.1.tgz

2.  Uncompress the files using following commands

tar –xzvf pecl_http-1.6.1.tgz

cd pecl_http-*

Note : If there is one more directory after untar please remove that.

3.  Compile and install using these commands (Just run one after another)

A.  phpize

B.  ./configure

C.  make

D.  make install

4.  After completing step 3 add following line in your PHP.INI file.
Now a day’s giving php.ini access is fashion!

extension=http.so

5. Add newly installed pecl_http php extension to php.ini file. Its important to add correct path, if you are installing from root this step is not required.

extension_dir=/home/this_is_your_server_path/html/pecl_http-1.6.1/modules

Thats it!

Share

One thought on “How to Install PECL Library in shared server?

  1. Pingback: Using images to validate forms « Custom PHP Design

Leave a Reply

Your email address will not be published. Required fields are marked *