PHPGurukul

PHP – PECL

PECL is the PHP Community Library, available on the Web at http://pecl.php.net/. PECL seeks to extend PHP’s capabilities through low-level language modules which are written in the C programming language and must be integrated directly into the PHP engine(usually through compilation). PECL extensions are distributed as compressed TAR archives and can be installed to any PHP development system either through the manual compile-and-install processor with the PECL installer(included with every PHP distribution).

Installing PECL Extensions

The procedure for installing a PECL extension is differ n UNIX and Windows. To download compile and install a PECL extension on UNIX all in one fell swoop, issue the following command at shell prompt:

Shell>pecl install extension-name

The PECL installer will now connect to the PECL server, download the source code, compile it and install it to appropriate location on your system. Fig 12-4 has an example of installing the Zip extension, available from http://pecl.php.net/pacakage/zip.

Alternatively, download the package source code and manually compile it into a loadable PHP module:

shell# cd zip-1.8.10
shell# phpsize
shell# ./configure
shell# make
shell# make install

This process should generate a loadable PHP module name zip.so and copy it to the PHP extension directory. It will now need to enabled in the php.ini configuration file.
Windows user has a much easier time of it: they need to simply download a precompiled PECL extension, copy it into PHP’s extension directory and then activate the extension in the php.ini configuration file. Precompiled PECL extension for Windows are freely available on the Web, at http//pecl4win.php.net/.
Once the extension has been correctly installed and activated, restart the Web server and check the output of the phpinfo() command. If extension has been correctly installed, phpinfo() will display an entry for the extension as in fig

You can find more information on installing PECL extensions in the PHP manual at www.php.net/manual/install.pecl.php.

Anuj Kumar

This is Anuj Kumar. I’m a professional web developer with 4+ year experience. I write blogs in my free time. I love to learn new technologies and share with others.
I founded PHPGurukul in September 2015. The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops and other web development tutorials.
.

Recommended Tutorials for you


Add comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.