cannot get phing to run at all

纵然是瞬间 提交于 2019-12-01 03:35:54

Seems like include_path is somehow broken.

Check PEAR's directory:

pear config-get php_dir
/usr/lib/php

Whatever directory is returned, it should contain PEAR files (System.php and phing files in particular)

Check that correct php.ini is used:

Run php --ini and see what INI file is being loaded. Then make sure this INI files contains PEAR directory in it's include_path

Check include_path:

Run 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. This means that wrong php.ini is being loaded for CLI PHP. To fix it, find correct php.ini file (step 2) and add

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.

then i add /Application/XAMPP/bin and /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.

I solve it simple ... i just changed the order of /etc/paths folders ...

as you see my /etc/paths file:

/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

  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]

you are done! type phing and you should ask for your build.xml

Kneel-Before-ZOD

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!