为什么 $pear->packageExists() 在安装的包上总是返回 false? [英] Why $pear->packageExists() returns always false on installed package?

查看:24
本文介绍了为什么 $pear->packageExists() 在安装的包上总是返回 false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了邮件 (http://pear.php.net/package/Mail)通过

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?

如果我再次尝试安装 Mail,我会得到:

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

我的 include_path 设置:

My include_path settings:

include_path = ".;C:\Program Files (x86)\IIS Express\PHP\v5.3\pear;"

邮件包安装到 C:\Program Files (x86)\IIS Express\PHP\v5.3\pear\Mail 目录

Mail package was installed to C:\Program Files (x86)\IIS Express\PHP\v5.3\pear\Mail dir

重新安装邮件没有帮助

推荐答案

我认为您使用了错误的注册表文件.

I think you're using the wrong registry file.

尝试将 PEAR 安装目录作为第一个参数传递给 PEAR_Registry 构造函数.它是 .registry 目录所在的目录,例如/usr/share/php/.

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/.

这篇关于为什么 $pear->packageExists() 在安装的包上总是返回 false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆