Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

php - Wamp 2.2 install PEAR

My operating system is Windows 7. I got my WAMP2.2 install in my computer. Then I try to install PEAR. However, I can not find my go-pear.bat file in my wamp directory. Fine. I download in here: http://pear.php.net/go-pear.phar and install using this file. I put the file in

 C:/wamp/bin/php/php5.3.8/pear/go-pear.phar

Run the command: php -d phar.require_hash=0 PEAR/go-pear.phar After the installation, I include the path of pear in php.ini in php and apache folder. I also include C:/wamp/bin/php/php5.3.8/ in windows $PATH variable. But when I run pear command. It said it can not find the pear command. I check the folder and just find a file called pear.bat and pear.ini. I tried to run pear.bat again in command line. It still does not work. Experts, please help on this issue.

question from:https://stackoverflow.com/questions/8276682/wamp-2-2-install-pear

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ok since many people may be asking the same thing. Let's suppose the following. I'm currently running 2.2 E which includes Apache 2.2.22 – Mysql 5.5.24 – PHP 5.3.13 XDebug 2.1.2 XDC 1.5 PhpMyadmin 3.4.10.1 SQLBuddy 1.3.3 webGrind 1.0

Now, to install PEAR do the following:

Download this file: http://pear.php.net/go-pear.phar

And put it on your WAMP server directory under the PHP version on the bin folder. Run the command to install PEAR and you're over it.

Example (defaults, no change has been done)

  1. Get the file on the link ->http://pear.php.net/go-pear.phar
  2. Go to this directory C:wampinphpphp5.3.13
  3. Open command prompt (cmd.exe). Supposing you're using Windows Vista and higher, press Start, type "cmd.exe" and right click on it and select run as administrator/CTRL+SHIFT+Enter (Haven't tested on non-priviliges rights)
  4. Use Window's cd command to change the directory to the go-pear.phar file you've just downloaded. In my case I'll be pin pointing it to my own directory, so I did it like follows:

    cd "C:wampinphpphp5.3.13"

  5. Press Enter. You should note that instead of saying "C:system32" is now displaying C:wampinphpphp5.3.13

  6. Write the following command and press Enter:

    php -d phar.require_hash=0 go-pear.phar

  7. Select whether you like or not a local copy or a system one. By typing system:local and pressing enter you'll install a local copy. By typing system and pressing enter you'll install a system-wide copy.

  8. Type yes to confirm the option chosen.

  9. The next list of directories, will be the referring directories that PEAR will install its components. If you select from 1 - 12 you can change the directory you'd like to install. By typing all and pressing Enter you'll be able to change them all in a queued manner. In my case, I just pressed Enter and left all defaults

DO THE FOLLOWING IN CASE YOU CONTINUE TO HAVE SOME LISTINGS 11. It is very probable that afterwards you'll receive a message like:

WARNING! The include+path defined in the currently used php.ini does not contain the PEAR PHP directory you just specified: If the specified directory is also not in the include_path used by your scripts, you will have problems getting any PEAR packages working.

Below it will also appear:

Would you like to alter php.ini ? [Y/n]:

Type y and press enter

This should put you running with PEAR on WAMP server :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...