最大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为pear运行config-get返回:
→ pear config-get php_dir
/usr/lib/php/pear检查此文件夹,system.php和phing.php都存在于此路径中。
发布于 2012-04-21 05:40:47
看起来include_path不知何故出了问题。
检查PEAR的目录:
pear config-get php_dir
/usr/lib/php无论返回什么目录,它都应该包含PEAR文件(特别是System.php和phing文件)
检查是否使用了正确的php.ini:
运行php --ini并查看正在加载的INI文件。然后确保这个INI文件的include_path中包含PEAR目录
检查include_path
运行php -c /path/to/php.ini -r 'echo get_include_path() . "\n";'。
更新
问题确实出在include_path上,因为错误消息报告了(include_path='.:'),这清楚地表明PEAR不在您的包含路径中。这意味着为CLI PHP加载的php.ini是错误的。要修复它,请找到正确的php.ini文件(步骤2)并添加
include_path = ".:/usr/lib/php/pear" 干杯。
发布于 2014-02-07 05:20:53
我很简单的解决了它。
我正在配置我的/etc/ path,以便在我的path环境中包含propel生成器。
然后添加/Application/XAMPP/bin和/Application/XAMPP/Propel/generator/bin
我得到的是包含错误。Mac系统预装了php ...所以,propel generator的php安装是错误的。
我很简单的解决了它。我刚刚更改了/etc/path文件夹的顺序...
如您所见,我的/etc/path文件如下:
/Applications/XAMPP/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/Applications/XAMPP/Propel/generator/bin发布于 2012-05-01 08:26:14
我只想为mac LION用户(那些通过macport安装东西的人)添加一个更简单的解决方案,可能也适用于leopard。
go-pear.phar
sudo php -q go-pear.phar
你的任务完成了!输入phing,您应该会询问您的build.xml
https://stackoverflow.com/questions/10253187
复制相似问题