Install PHP Pear and Pear Packages

What is PEAR?

PEAR is an acronym for¬†PHP Extension and Application Repository. PEAR is a massive repository for PHP code. It provide easy access to hundreds of classes that can be implemented into your existing PHP project. It saves you time since you won’t have to write anything from scratch and you can simply reuse the code from the PEAR repository.

A few examples of the types PEAR packages available to you are packages such as encryption, mailing, image manipulation, benchmarking, caching, authenticating and so much more.

Install PHP Pear

Now that you know what PEAR is, you may be asking “how do i install PHP PEAR?”.

Under Debian this is quite simple. Enter the following command and it will download and install PEAR for you straight out the box.

$ apt-get install php-pear

It should really be that simple.

Installing a PEAR Package for PHP

Once you have installed PEAR, you can being installing all your much needed PEAR packages. To do this is a matter of entering the following:

$ pear install package-name

Where package-name is the name of the PEAR package you wish to install. So if I wanted to install the Auth_HTTP package, I would do this:

$ pear install Auth_HTTP

Upgrading a PEAR Package for PHP

Now to upgrade a PEAR package is pretty much the same as installing it.

$ pear upgrade package-name

Conclusion

Using PEAR packages will rapidly speed up your development since you will be using classes that are already complete with all the functionality you require instead of manually having to code from scratch. You can then focus on what is important, building amazing websites and programs that amaze everyone who comes to visit!