What do we have in this session?
PHP and PEAR/PECL
PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the pear fruit. The purpose of PEAR is to provide:
1. A structured library of open-source code for PHP users.
2. A system for code distribution and package maintenance.
3. A standard style for code written in PHP.
4. The PHP Extension Community Library (PECL).
5. A web site, mailing lists and download mirrors to support the PHP/PEAR community.
PEAR is a community-driven project governed by its developers. PEAR's governing bodies are subdivided into the PEAR Group, Collectives, and a President. PEAR's constitution (adopted in March 2007) defining these groups are documented here. The PEAR project was founded in 1999 by Stig S. Bakken.
PECL (pronounced "pickle") is a separate project that distributes PHP extensions (compiled code written in C, such as the PDO extension). PECL extensions are also distributed as packages and can be installed using the PEAR installer with the pecl command. More information and all PECL packages can be found at PECL homepage.
Assuming IIS and PHP are working nicely, now, let configure and update PEAR packages. Firstly, manually execute the batch file, go-pear.bat located in c:\php\go-pear.bat. The batch file should reside under PHP root folder.
The setup will ask you some questions and afterwards the PEAR Package Manager will be installed in the path, which you have specified during installation. Run go-pear at the command prompt.
Just press the Enter key to accept the defaults.
Finally you have to add that installation path to your PATH environment. Either do this manually (Start > Control Panel > System > Environment) or run (double-click) the newly generated PEAR_ENV.reg that's now found in the PHP root directory. In this case we, double click the reg file. This will modify the Windows registry file and Windows path environment variables automatically.
Click Yes and then OK.
You can verify the previous task in Windows Environment Variables page as shown in the following screenshots.
Running the pear Command from Windows Console
Now, pear command (pear.bat) is available. After that you can access the PEAR Package Manager by running pear command from Windows command prompt.
To update your PEAR packages, request/load https://pear.php.net/go-pear page from your Internet browser.
Save the file to a local and name it go-pear.php.
Then run the following command from the command prompt and follow the step-by-step instructions.
Well, PEAR should be 'installed' and configured for update successfully at this stage.