Once PHP 5.2.0 is installed and you are pursuing the MYSQL 5.X installation one is instructed to install PEAR. The first question you are likely to ask is What is PEAR? and the next is Why?
WHAT IS PEAR?
PEAR stands for PHP Extension and Application Repository, PEAR is a framework and distribution system for reusable PHP components. PEAR is a community-driven project with the PEAR Group as the governing body. The project was founded by Stig S. Bakken in 1999.
The code in PEAR is partitioned in packages, where each package is a separate project with its own development team, version number, release cycle, documentation and a defined relation to other packages (including dependencies). Packages are distributed as gzipped tar files with a description file inside, and installed on your local system using the PEAR installer. There are two types of packages: source packages (containing source files only), and binary packages (containing platform-specific binary files, and possible source files). [Source: PEAR Manual]
WHY USE PEAR?
PEAR's DB classes allow a clear, concise and stable extension for developers to leverage severa packages in this case the database package and actions that would work for MySQL, Oracle, PostgreSQL etc. The very implementation of PEAR connects PHP and MYSQL through the DB.php framework.
The instructions to install PEAR are fairly simple and start off by going to the PHP installation directory and executing go-pear.bat. However, there is an error in the go-pear.phar that is included in the php-5.2.0-win32-installer.msi installation archive which is listed below:
C:\PHP>go-pear.bat
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :
Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation base ($prefix) : C:\PHP
2. Binaries directory : C:\PHP
3. PHP code directory ($php_dir) : C:\PHP\pear
4. Documentation directory : C:\PHP\pear\docs
5. Data directory : C:\PHP\pear\data
6. Tests directory : C:\PHP\pear\tests
7. Name of configuration file : C:\WINDOWS\pear.ini
8. Path to CLI php.exe : C:\PHP\.
1-8, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\WINDOWS\pear.ini...
Initialized registry...
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command.php on line 268
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command.php on line 268
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command.php on line 268
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command.php on line 268
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command.php on line 268
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command.php on line 268
Preparing to install...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.1.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.4.11.tar...
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/Archi
ve/Tar.php on line 2334
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/Archi
ve/Tar.php on line 2338
Could not get contents of package "". Invalid tgz file.
Cannot initialize 'phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.1.t
ar', invalid or missing package file
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/Archi
ve/Tar.php on line 2334
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/Archi
ve/Tar.php on line 2338
Could not get contents of package "". Invalid tgz file.
Cannot initialize 'phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.
tar', invalid or missing package file
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/Archi
ve/Tar.php on line 2334
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/Archi
ve/Tar.php on line 2338
Could not get contents of package "". Invalid tgz file.
Cannot initialize 'phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.4.11.tar', i
nvalid or missing package file
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command/Install.php on line 427
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command/Install.php on line 427
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command/Install.php on line 427
PHP Warning: Cannot use a scalar value as an array in phar://go-pear.phar/PEAR/
Command/Install.php on line 429
install failed
Press any key to continue . . .
C:\PHP>cd pear
There are several references through out the search engines referring to this problem. I spent a good amount of time trying to seek a solution to this issue. Latest one I found was spanning from October 2006 to November 2006 found here. Which simply leads to a thread discussing a solution. However, I could not find the proper go-pear.phar and it appears. The discussion infers the solution has not been implemented in the newest of releases in November of 2006. My resulting effort could not find a solution on the PHP or PEAR websites on this time January 22, 2007.
However, I did find go-pear.phar from Greg Beaver's blog. This solution has not been implemented in the newest of releases at the time of this entry, January 22, 2007. The blog entry describes the issue and provides the file. I wanted to document it for myself as well as spread the word around!
Hope this helps!
http://pear.php.net/bugs/bug.php?id=9925 gives a better solution:
Thank you so much. I was pulling my hair out!! You and Greg Beaver are
HEROES!!
damn, this helped me a lot, thanks a lot!