使用pecl为MAMP安装Xdebug

问题描述 投票:6回答:3

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,这表明该包显然存在。

我还能尝试什么?

install xdebug pecl
3个回答
5
投票

尝试运行以下命令,

pecl channel-update pecl.php.net


1
投票

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

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

1
投票

Installing as root may fix it

尝试通过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访问权限的远程在线安装程序感觉非常不确定。但这显然是我个案所需要的。

© www.soinside.com 2019 - 2024. All rights reserved.