【问题标题】:Installing Xdebug for MAMP with pecl使用 pecl 为 MAMP 安装 Xdebug
【发布时间】:2015-07-22 10:47:08
【问题描述】:

http://xdebug.org/docs/install 我读到:

Installing with PEAR/PECL is as easy as:

# pecl install xdebug

当我尝试这个时,我得到了错误:

$ pecl install xdebug
bash: pecl: command not found

再试一次,从包含 pecl 的文件夹中:

cd /Applications/MAMP/bin/php/php5.5.3/bin/
bash-3.2$ ./pecl install xdebug
No releases available for package "pecl.php.net/xdebug"
install failed

但是访问pecl.php.net/xdebug会重定向到http://pecl.php.net/package/xdebug,这表明该包明显存在。

我还能尝试什么?

【问题讨论】:

    标签: installation xdebug pecl


    【解决方案1】:

    尝试运行以下命令,

    pecl 频道更新 pecl.php.net

    【讨论】:

    • 这是在 linux mint 上为我完成的,不过你可以考虑将它作为 sudo 运行。
    【解决方案2】:

    为了让它工作,我所做的是使用以下命令手动编译和安装调试扩展:

    wget http://xdebug.org/files/xdebug-x.x.x.tgz
    tar -xzvf xdebug-x.x.x.tgz
    cd xdebug-x.x.x
    phpize
    ./configure
    make
    make install
    

    【讨论】:

    • 安装在哪里重要吗?有理想的位置吗?
    【解决方案3】:

    以root身份安装可能会修复它

    我在尝试通过 PECL 安装 Xdebug 时收到了同样的错误消息。当我尝试关注user1310789’s advice 更新频道时,我收到了与this question 相同的错误消息:

    Updating channel "pecl.php.net"
    Channel "pecl.php.net" is not responding over http://, failed with message:
    Connection to 'pecl.php.net:80' failed: Connection refused
    Trying channel "pecl.php.net" over https:// instead
    Cannot retrieve channel.xml for channel "pecl.php.net" (Connection to `pecl.php.net:443' failed: Connection refused)
    

    对该问题的公认答案间接持有答案。我不必创建代理,但我注意到答案中的 pear 命令是以 root 身份运行的。

    我尝试使用sudo 更新 PEAR 和 PECL 频道 - 瞧,它立即生效。安装 Xdebug 仍然失败并出现同样的错误,但 sudoing 再次修复它。

    为什么 PEAR 和 PECL 似乎突然需要以 root 身份运行才能运行我不知道。运行具有 root 访问权限的远程在线安装程序,感觉非常可疑。但这显然是我的情况所需要的。

    【讨论】:

      【解决方案4】:

      这对我有用。安装在 Mac 上,但不是 MAMP

      brew install php
      sudo pecl install xdebug
      

      【讨论】:

        猜你喜欢
        • 2014-02-05
        • 1970-01-01
        • 1970-01-01
        • 2013-11-28
        • 1970-01-01
        • 2013-02-21
        • 1970-01-01
        • 2012-12-04
        • 1970-01-01
        相关资源
        最近更新 更多