The PHP Extension and Application Repository, or PEAR, is a framework and distribution system for PHP code components. Stig S. Bakken founded the PEAR project in 1999 to promote the re-use of code that performs common functions.

The project has the goals of:

  • providing a structured library of code
  • maintaining a system for distributing code and for managing code packages
  • promoting a standard coding-style

Though community-driven, the PEAR project has a PEAR Group which serves as the governing body and takes care of administrative tasks. Each PEAR code package comprises an independent project under the PEAR umbrella. It has its own development team, versioning-control and documentation. A PEAR package can consist of source code or binaries or both. Unlike the Comprehensive Perl Archive Network (CPAN) archives, which PEAR took as its model, PEAR packages do not have implicit dependencies so that a package's placement in the PEAR package tree does not relate to code dependencies. Rather, PEAR packages must explicitly declare all dependencies on other PEAR packages.

The PEAR base classes contain code for simulating object-oriented destructors and consistent error-handling. Packages exist for many basic PHP functions including authentication, caching, database access, encryption, configuration, HTML, web services and XML.

The PHP Extension Community Library (PECL) contains C extensions for compiling into PHP. PECL includes modules for XML-parsing, access to additional databases, mail-parsing, embedding Perl or Python in PHP scripts and for compiling PHP scripts. PECL spun off from the PEAR Project in 2003 and now operates independently of PEAR.