< Running and Testing PHP Engine on Windows | Java & Friends  | WinPcap on Windows XP Pro SP2 >


 

 

PHP and PEAR/PECL on Windows XP Pro SP2

 

 

What do we have in this session?

  1. PHP and PEAR/PECL

  2. The PHP Extension Community Library (PECL)

  3. Configuring and Updating PEAR package

  4. Running the pear Command from Windows Console

 

 

 

 

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.

 

The PHP Extension Community Library (PECL)

 

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.

 

Configuring and Updating PEAR package

 

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.

 

Executing the batch file, go-pear.bat located in c:\php\go-pear.bat from Windows console

 

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.

 

Running the go-pear at the Windows command prompt

 

 

Running the go-pear at the Windows command prompt - accepting the default settings

 

Just press the Enter key to accept the defaults.

 

Running the go-pear at the Windows command prompt - the download process begins

 

 

Running the go-pear at the Windows command prompt - the download and install process for PHP extension was succeeded

 

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.

 

Running the go-pear at the Windows command prompt - adding the registry keys by running PEAR_ENV.reg file

 

Click Yes and then OK.

 

Running the go-pear at the Windows command prompt - registry auto editing prompt message

 

Running the go-pear at the Windows command prompt - registry auto editing prompt message for successful operation

 

You can verify the previous task in Windows Environment Variables page as shown in the following screenshots.

 

 

 

 

----------------------------------------------------------------------

Running the go-pear at the Windows command prompt - the PHP path settings in the environment variables looks fine

 

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.

 

Running the pear command from Windows command prompt without any option

 

To update your PEAR packages, request/load https://pear.php.net/go-pear page from your Internet browser.

 

To update your PEAR packages, request or load https://pear.php.net/go-pear page from your Internet browser

 

Save the file to a local and name it go-pear.php.

 

Saving the file to a local and name it go-pear.php

 

 

 

 

The go-pear.php file is ready to be run

 

Then run the following command from the command prompt and follow the step-by-step instructions.

 

C:\>php go-pear.php
 

 

Running the php go-pear.php from Windows console

 

Updating the PEAR packages from Windows command line

 

 

The PEAR, PHP extension update is in progress

 

The PEAR, PHP extension update was completed

 

Well, PEAR should be 'installed' and configured for update successfully at this stage.

 

 

 

 


< Running and Testing PHP Engine on Windows | Java & Friends  | WinPcap on Windows XP Pro SP2 >