问题
C:\PHP>pear upgrade pear
pear/pear is already installed and is the same as the released version 1.9.3
upgrade failed
C:\PHP>pear -V
PEAR Version: 1.9.0
PHP Version: 5.2.17
Zend Engine Version: 2.2.0
As you can see pear is confused to what version it is running. How can I go about fixing this so that PEAR is running on 1.9.3?
Update
C:\PHP>pear upgrade -f pear
downloading PEAR-1.9.3.tgz ...
Starting to download PEAR-1.9.3.tgz (295,774 bytes)
.............................................................done: 295,774 bytes
upgrade ok: channel://pear.php.net/PEAR-1.9.3
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
C:\PHP>pear -V
PEAR Version: 1.9.0
PHP Version: 5.2.17
回答1:
use pear upgrade -f pear
this will force to upgrade if the upgrade version is newer
to use the channel try giving this command
pear upgrade --force pear
this will update the base pear
回答2:
Is pear
really located in C:\PHP
or just within your path? I'm thinking that for some reason, there are two PEAR installations.
回答3:
You have two pear installations and upgrade the second pear with the first pear command.
Do a
$ pear list pear
...
script /usr/bin/pear
This is the pear script you want to execute. You are executing another one. Delete the other one and set your PATH variable to contain the correct path.
回答4:
I uninstalled php and re-installed it again. All the problems then went away.
来源:https://stackoverflow.com/questions/6277938/pear-on-windows-displaying-different-version-numbers