PHP

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 manual compile-and-install process or 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:

[sam_zone id=”3″ codes=”true”]

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:

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 have 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.

About the author

Anuj kumar

I'm Anuj kumar a 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 is provide php , jquery , mysql , phpoops and other web development tutorials. I am trying best effort to make PHPGurukul useful for every single moment spend on this website. If you think this website is useful to visit please share with your friend and buddies.

Leave a Comment