installing php pear extensions
Well, i always forget how this is done, but its actually really easy.
- Navigate to your php install directory. for me, i go start-> run -> cmd.exe
You PHP install dir may be different. If you used xampp, its probably C:\xampp\php. The default location of Apache 2.2 if you install it by itself is something like c:\program files\apache software foundation\apache2.2\php
- Then at that command prompt, say I want to add the Math_Numerical_RootFinding PEAR package to my php install:
C:\Apache2.2\php>pear install Math_Numerical_RootFinding
And that’s it! PHP automatically resolves the network connection and downloads the latest build of the package.
IF the package you’re trying to get is still in BETA (as some of the good ones seem to be stuck in a perpetual beta), then you would have to pay attention to the error message that appears when you try to install it.
So for example, I wanted the Math_Polynomial package, so I try:
pear install Math_Polynomial
But it comes back at me with
Failed to download pear/Math_Polynomial within preferred state “stable”, latest release is version 0.1.0, stability “beta”, use “channel://pear.php.net/Math_Polynomial-0.1.0” to install
Cannot initialize ‘channel://pear.php.net/Math_Polynomial’, invalid or missing package file
Package “channel://pear.php.net/Math_Polynomial” is not valid
So you have to do:
pear install Math_Polynomial-0.1.0