简体   繁体   English

根本无法让phing运行

[英]cannot get phing to run at all

Max OS X 10.7.. when i run phing -v i get the following errors: 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

Here are the commands i used: 以下是我使用的命令:

pear config-set auto_discover 1
pear install phing/phing

Here is my php.ini: 这是我的php.ini:

include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php"

running whereis for php, pear, and phing returns: 运行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

running config-get for pear returns: 为pear返回运行config-get:

→ pear config-get php_dir
/usr/lib/php/pear

checking this folder, system.php and phing.php both exist in this path. 检查此文件夹, system.phpphing.php都存在于此路径中。

Seems like include_path is somehow broken. 似乎include_path在某种程度上被打破了。

Check PEAR's directory: 检查PEAR的目录:

pear config-get php_dir
/usr/lib/php

Whatever directory is returned, it should contain PEAR files ( System.php and phing files in particular) 无论目录返回,它应该包含PEAR文件( System.phpphing文件特别)

Check that correct php.ini is used: 检查是否使用了正确的php.ini

Run php --ini and see what INI file is being loaded. 运行php --ini并查看正在加载的INI文件。 Then make sure this INI files contains PEAR directory in it's include_path 然后确保此INI文件包含其include_path中的PEAR目录

Check include_path : 检查include_path

Run php -c /path/to/php.ini -r 'echo get_include_path() . "\\n";' 运行php -c /path/to/php.ini -r 'echo get_include_path() . "\\n";' php -c /path/to/php.ini -r 'echo get_include_path() . "\\n";' .


Update 更新

The problem is indeed with include_path since the error message reports (include_path='.:') which clearly shows that PEAR is NOT in your include path. 问题确实在于include_path因为错误消息报告(include_path='.:') ,这清楚地表明PEAR不在您的包含路径中。 This means that wrong php.ini is being loaded for CLI PHP. 这意味着正在为CLI PHP加载错误的php.ini To fix it, find correct php.ini file (step 2) and add 要修复它,找到正确的php.ini文件(步骤2)并添加

include_path = ".:/usr/lib/php/pear" 

to it. 它。

I solve it simple ... 我解决它很简单......

i'm configuring my /etc/paths to include propel generator on my path ambient. 我正在配置我的/ etc /路径以在我的路径环境中包含推进发生器。

then i add /Application/XAMPP/bin and /Application/XAMPP/Propel/generator/bin 然后我添加/ Application / XAMPP / bin和/ Application / XAMPP / Propel / generator / bin

i was getting that include error. 我得到的包括错误。 Mac system comes with php preinstalled ... so, propel generator was getting wrong php installation. Mac系统自带php预装...所以,推进生成器错误的PHP安装。

I solve it simple ... i just changed the order of /etc/paths folders ... 我解决它很简单...我只是改变了/ etc / paths文件夹的顺序......

as you see my /etc/paths file: 当你看到我的/ etc / paths文件时:

/Applications/XAMPP/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/Applications/XAMPP/Propel/generator/bin

Just Want to add one more easier solution for mac LION users (those who install stuff via macport ) , might work for leopard too 只想为mac LION用户(通过macport安装内容的用户)添加一个更简单的解决方案,也可能适用于豹子

  1. download this script anywhere, doesn't matter where it is 在任何地方下载此脚本,无论在何处都无关紧要

     curl http://pear.php.net/go-pear.phar > go-pear.phar 
  2. run this command 运行此命令

     sudo php -q go-pear.phar 
  3. it will ask you the paths, you shouldn't need to change it, but just check these paths contains any pear related files. 它会问你路径,你不应该改变它,但只需检查这些路径包含任何梨相关的文件。

  4. it will ask you if you want to update php.ini for you with these includes path [Y] 它会询问你是否要为你更新php.ini这些包括路径[Y]

you are done! 你完成了! type phing and you should ask for your build.xml 键入phing,你应该要求你的build.xml

Or if you don't have access to the server, you can do this: 或者,如果您无权访问服务器,则可以执行以下操作:

$root = $SERVER['DOCUMENT_ROOT'];

It'll always reference the root of your project, and you can then reference the folder/file from that. 它将始终引用项目的根目录,然后您可以从中引用文件夹/文件。
You don't have to touch the server if done that way. 如果这样做,您不必触摸服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM