Page 1 of 1

Pear wont install on Windows XP

Posted: Mon Jan 15, 2007 12:20 pm
by s0me0ne
I followed the following steps (pasting them here cuz the site I found them on is very slow)
1. Edit the go-pear.bat to look like this:

@ECHO OFF
set PHP_BIN=php.exe
%PHP_BIN% -d output_buffering=0 PEAR\go-pear.php
pause

The second line needs to point to you php.exe from the directory where the go-pear.bat. So in the case of AppServ it is default to the same directory.
The third line needs to point to go-pear.php. Note: this is not go-pear.bat. You do not have the go-pear.php file yet.

2. create an empty file in the PEAR directory named go-pear.php.

3. go to http://www.go-pear.org and copy the contents on this page into your go-pear.php and save.

4. Run (double-click) go-pear.bat

After you hit enter to install and enter your proxy (if any) and enter 'Y' to install DB, etc, you will see items 1-7 with some values populated.
I changed #1 from C:\AppServ\php\PEAR to be C:\AppServ\php but you can leave it if you like. I think if I do it over I would not change the default. I had to enter in #7, which is the path to php.exe, since it was empty to be c:\appserv\php. Note don't add trailing "\" or "\php.exe" to this path.

Verify everything and hit enter.

Follow the directions as prompted. I think the only other thing you need to do is after the script is done is double click on PEAR_ENV.reg file that will be in the directory where you entered for option #1 in step 4.

5. open pear.bat which is in the directory where you entered for option #1 in step 4 in notepad. Go to the end of the file. You need to add the option "-d register_argc_argv=On " in the line that looks like this:

"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9

It should look like this:
"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d register_argc_argv=On -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9

Make this change and save this file.

6. Open the windows command prompt. Go to the directory where your pear.bat file is and type "pear" into the command window. This will show all the options your can do with the installer.

ex. If you want to install HTML_QuickForm you need to first install the dependent package HTML_Common. So first type the following in the command window:
pear install HTML_Common
this will install this pacakage. now I can install HTML_QuickForm by typing the following:
pear install HTML_QuickForm

and followed it but got a problem when running go-pear.bat (i did put in c:\appserv\php for the php.exe path)

fatal error: undefined class name 'pear' in D:\appserv\php\PEAR\go-pear.php on line 747

press any key to continue

I'm not sure what the deal is, i've looked at http://www.go-pear.org/manual/en/instal ... etting.php but its not helping either

any help would be appreciated

Posted: Mon Jan 15, 2007 12:41 pm
by jayshields
You would probably be better off checking the official website for the installtion guide.

EDIT | I see your link also goes to the official website... why not read some of the related pages too? I'm sure they will answer your questions.