Max 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
Run Code Online (Sandbox Code Playgroud)
pear config-set auto_discover 1
pear install phing/phing
Run Code Online (Sandbox Code Playgroud)
include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php"
Run Code Online (Sandbox Code Playgroud)
bash-3.2$ whereis php
/usr/bin/php
bash-3.2$ whereis pear
/usr/bin/pear
bash-3.2$ whereis phing
/usr/bin/phing
Run Code Online (Sandbox Code Playgroud)
? pear config-get php_dir
/usr/lib/php/pear
Run Code Online (Sandbox Code Playgroud)
检查此文件夹,system.php并且phing.php都存在于此路径中.
gal*_*han 24
似乎include_path是某种程度上被打破了.
pear config-get php_dir
/usr/lib/php
Run Code Online (Sandbox Code Playgroud)
无论目录返回,它应该包含PEAR文件(System.php和phing文件,特别)
php.ini使用了正确的:运行php --ini并查看正在加载的INI文件.然后确保这个INI文件包含PEAR目录include_path
include_path:跑php -c /path/to/php.ini -r 'echo get_include_path() . "\n";'.
更新
确实存在问题,include_path因为错误消息报告(include_path='.:')清楚地表明PEAR不在您的包含路径中.这意味着php.ini为CLI PHP加载了错误.要修复它,找到正确的php.ini文件(步骤2)并添加
include_path = ".:/usr/lib/php/pear"
Run Code Online (Sandbox Code Playgroud)
它.