Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are differences between PECL and PEAR?

Tags:

php

pear

pecl

People also ask

Is pecl deprecated?

Unlike other reports, the pear/pecl tools are not deprecated in PHP. They're merely not being enabled by default. The pecl tool is the only official way to fetch and compile PHP extensions. Unless there is an official replacement, please continue building the default docker images with the --with-pear flag.

What is pecl in Linux?

PECL (PHP Extension Community Library) is a spin-off of PEAR, and is primarily used to house groups of functions that are no longer bundled with the default installation of PHP. As of PHP 5, these extensions can be downloaded and installed separately from the regular PHP download.

What is PEAR in linux?

Pear Linux is an stable, fast and powerful open source operating system based on Ubuntu Desktop distribution. The latest release was Pear Linux 6.1 code named (Bartlett) was created by David Tavares.


PECL stands for PHP Extension Community Library, it has extensions written in C, that can be loaded into PHP to provide additional functionality. You need to have administrator rights, a C compiler and associated toolchain to install those extensions.

PEAR is PHP Extension and Application Repository, it has libraries and code written IN php. Those you can simply download, install and include in your code.

So, yes they are similar, but yet so different :)


PECL is a repository of C extensions for PHP. Those extensions are usually installed via the pecl command, which is an alias for pear, with the default channel/repository set to pecl.php.net.

PEAR is multiple things:

  1. The package installer (pear command) that is able to install packages from different channels (repositories), including pecl.php.net. Many consider composer the successor of the pear installer.
  2. The package repository http://pear.php.net/packages.php with ~600 libraries. Many of them are composer-installable.
  3. A PHP coding standard that is available with PHP_CodeSniffer.

pear is a php classes written in php Whereas pecl is extensions which not written in php and need compiling .


PEAR as-such is not a coding standard. Instead PEAR "follows" a set coding standard that is encouraged within the PHP Community. This is however not the only coding standard that PHP users can follow, the ZF, for eg. recommends a slightly different standard.


PEAR is also a coding standard ;-) php_codesniffer (install via $pear install php_codesniffer ) is a tool that will scan your code and hilight where it deviates from that or any other supported coding standard.