Mac OS X 10.7..当我运行时phing -v
我收到以下错误:
Warning: require_once(phing/Project.php): failed to open stream: No such file or directory in /usr/lib/php/pear/phing/Phing.php on line 22
Fatal error: require_once(): Failed opening required 'phing/Project.php' (include_path='.:') in /usr/lib/php/pear/phing/Phing.php on line 22
这是我使用的命令:
pear config-set auto_discover 1
pear install phing/phing
这是我的 php.ini:
include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php"
为 php、pear 和 phing 运行 whereis 返回:
bash-3.2$ whereis php
/usr/bin/php
bash-3.2$ whereis pear
/usr/bin/pear
bash-3.2$ whereis phing
/usr/bin/phing
运行 config-get 获取 pear 返回:
→ pear config-get php_dir
/usr/lib/php/pear
检查这个文件夹,system.php
and phing.php
两者都存在于这条路径中。
似乎include_path
不知何故被打破了。
检查 PEAR 的目录:
pear config-get php_dir
/usr/lib/php
无论返回什么目录,它都应该包含 PEAR 文件(System.php
and phing
特别是文件)
检查是否正确php.ini
用来:
Run php --ini
并查看正在加载什么 INI 文件。然后确保这个 INI 文件中包含 PEAR 目录include_path
Check include_path
:
Run php -c /path/to/php.ini -r 'echo get_include_path() . "\n";'
.
Update
问题确实在于include_path
由于错误消息报告(include_path='.:')
这清楚地表明 PEAR 不在您的包含路径中。这意味着错误php.ini
正在为 CLI PHP 加载。要修复它,找到正确的php.ini
文件(步骤 2)并添加
include_path = ".:/usr/lib/php/pear"
to it.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)