2011-02-25 15:05
浏览 23


I am on a mac running Leopard. I installed pear successfully via macports variant. When I type in pear in the terminal I get a list of commands which is what you should get.

PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0
Running on: Darwin demetrius-fords-macbook-pro-53.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386. 

when I type in which pear I get: /opt/local/bin/pear. That's where pear is located and I also have /opt/local/bin first in my bash_login file also. So when I go to install phpunit I get this error:

demetrius-fords-macbook-pro-53:~ demet8$ pear channel-discover pear.phpunit.de
could not create lock file: fopen(/usr/local/PEAR/.lock): failed to open stream: Permission denied

It looks as though it's looking for pear in the wrong path? I thought macports would have created a symlink for the pear install? what would I need to do? thanks..

图片转代码服务由CSDN问答提供 功能建议

我在运行Leopard的mac上。 我通过macports变种成功安装了pear。 当我在终端输入pear时,我会得到一个命令列表,这是你应该得到的。

运行于:Darwin demetrius-fords-macbook-pro-53。 本地9.8.0 Darwin内核版本9.8.0:Wed Jul 15 16:55:01 PDT 2009;  root:xnu-1228.15.4~1 / RELEASE_I386 i386。  

当我输入中的哪个pear 时:/ opt / local / bin / pear。 这就是pear的位置,我的bash_login文件中也首先有 / opt / local / bin 。 因此,当我去安装phpunit时,我收到此错误:

  demetrius-fords-macbook-pro-53:~demet8 $ pear channel-discover pear.phpunit.de 
could 不创建锁文件:fopen(/usr/local/PEAR/.lock):无法打开流:权限被拒绝

看起来好像正在寻找梨 在错误的道路上? 我以为macports会为pear安装创建一个符号链接? 我需要做什么? 谢谢..

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanjie1339 2011-02-25 15:13

    I'm not to sure how that work on a mac but see if pear is using the right path you can check

    pear config-show and use pear config-set to change them if needed

    That should be the important ones:

    PEAR executables directory     bin_dir          /opt/lampp/bin
    PEAR documentation directory   doc_dir          /opt/lampp/lib/php/doc
    PHP extension directory        ext_dir          /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613
    PEAR directory                 php_dir          /opt/lampp/lib/php
    PEAR Installer cache directory cache_dir        /tmp/pear/cache
    PEAR configuration file        cfg_dir          /opt/lampp/lib/php/cfg
    PEAR data directory            data_dir         /opt/lampp/lib/php/data
    PEAR Installer download        download_dir     /tmp/pear/download
    PHP CLI/CGI binary             php_bin          /opt/lampp/bin/php

    Maybe there is a better way to do that manually. I don't know any :)

    打赏 评论
  • dongzhong3688 2011-12-21 14:58

    You should actually type "sudo pear channel-discover pear.phpunit.de", not "pear channel-discover pear.phpunit.de", and then type you password.

    That way you will validate your self to the system as user (admin) with enough privileges to do the action, so to say.


    打赏 评论

相关推荐 更多相似问题