尝试在Windows上使用PEAR安装Predis

Firstly I'm new to PEAR and Predis...I want to install Predis on windows 7, and theres what I have done so far... I have installed Redis on my computer in C:/Redis. PEAR is in \wamp\bin\php\php5.3.10 and it was installed successfully. Now m trying to install Predis using

pear install nrk/Predis-1.0.0

It gives me the following errors

downloading Predis-1.0.0.tar ...
Starting to download Predis-1.0.0.tar (2,014,208 bytes)
...............................done: 2,014,208 bytes

Warning: require_once(Structures/Graph.php): failed to open stream: No such file
 or directory in PEAR\Downloader.php on line 1192
PHP Warning:  require_once(Structures/Graph.php): failed to open stream: No such
 file or directory in C:\wamp\bin\php\php5.3.10\pear\PEAR\Downloader.php on line
 1192
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0
PHP   2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:3
07
PHP   3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php5.3.10\pear\PEAR\C
ommand\Common.php:271
PHP   4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin\php\php5.3.10\pea
r\PEAR\Command\Install.php:699

Warning: require_once(Structures/Graph.php): failed to open stream: No such file
 or directory in C:\wamp\bin\php\php5.3.10\pear\PEAR\Downloader.php on line 1192


Call Stack:
    0.0010     881520   1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0

    0.0597    4753144   2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\
pear\pearcmd.php:307
    0.0597    4753144   3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php
5.3.10\pear\PEAR\Command\Common.php:271
   11.4545   13810008   4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin
\php\php5.3.10\pear\PEAR\Command\Install.php:699

PHP Fatal error:  require_once(): Failed opening required 'Structures/Graph.php'
 (include_path='C:\wamp\bin\php\php5.3.10\pear') in C:\wamp\bin\php\php5.3.10\pe
ar\PEAR\Downloader.php on line 1192
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0
PHP   2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:3
07
PHP   3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php5.3.10\pear\PEAR\C
ommand\Common.php:271
PHP   4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin\php\php5.3.10\pea
r\PEAR\Command\Install.php:699

Fatal error: require_once(): Failed opening required 'Structures/Graph.php' (inc
lude_path='C:\wamp\bin\php\php5.3.10\pear') in C:\wamp\bin\php\php5.3.10\pear\PE
AR\Downloader.php on line 1192

Call Stack:
    0.0010     881520   1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0

    0.0597    4753144   2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\
pear\pearcmd.php:307
    0.0597    4753144   3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php
5.3.10\pear\PEAR\Command\Common.php:271
   11.4545   13810008   4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin
\php\php5.3.10\pear\PEAR\Command\Install.php:699

ok.. after alot of searching... I installed Predis using Composer on Windows 7. The following is w.r.t Wamp server.

First of all, enable php_openssl in php.ini The steps I followed were,

  1. Install Redis from [here]https://github.com/rgl/redis/downloads to folder say, C:/Redis
  2. Install Composer from [here]https://getcomposer.org/download/ in the root of your website.
  3. Download Composer.phar in the root of your website.. sorry.. I didn't bookmark that link.. so I dont have it.. :(
  4. Write this file composer.json

    {"require": { "predis/predis": "1.1.*@dev" }}

and run this command

php composer.phar install

from the folder you have put these files (composer.phar and composer.json).. After that, in both php.ini (apache and php) write this include_path :

include_path='.;C:\wamp\www\vendor\predis'

Now write this code to test predis

<?php
require("predis/autoload.php");
Predis\Autoloader::register();
try {
$redis = new Predis\Client(array(
    "scheme" => "tcp",
    "host" => "127.0.0.1",
    "port" => 6379));

echo "Successfully connected to Redis";
echo $redis->ping();
}
catch (Exception $e) {
    echo "Couldn't connected to Redis";
echo $e->getMessage();
}

Wish you luck! :)