问题
I installed Mail (http://pear.php.net/package/Mail) by
pear install Mail
everything seems to be ok, but checking for this package programmatically:
$pear = new PEAR_Registry();
$enabled = $pear->packageExists('Mail');
always fails for me (false).
Could someone give me any advice?
If I try to install Mail once again, I am getting:
pear/Mail is already installed and is the same as the released version 1.2.0
install failed
My include_path settings:
include_path = ".;C:\Program Files (x86)\IIS Express\PHP\v5.3\pear;"
Mail package was installed to C:\Program Files (x86)\IIS Express\PHP\v5.3\pear\Mail dir
Reinstall Mail didn't help
回答1:
I think you're using the wrong registry file.
Try to pass the PEAR installation directory as first parameter to the PEAR_Registry
constructor. It's the directory in which the .registry
directory exists, e.g. /usr/share/php/
.
来源:https://stackoverflow.com/questions/16397770/why-pear-packageexists-returns-always-false-on-installed-package