使用PECL安装xdebug

使用PECL安装xdebug

本文介绍了Mac OS Snow Leopard&上的两个PHP版本.使用PECL安装xdebug的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读 Snow Leopard 上有关内置Apache/PHP的一些帖子之前,我曾经使用 MAMP (标准)进行PHP开发.我决定转移到我所能提供的位置,但似乎有很多问题.

I was using MAMP (standard) for PHP Development for some times before I read some posts about built-in Apache/PHP on Snow Leopard. I decided to shift to those I am provided with but seems to have many problems.

第一件事是,当我使用MAMP时,我从. phpunit命令对我来说效果很好.我也有Xcode4,但几周前将其删除(之所以提及是因为我不知道是什么原因导致了我的所有麻烦).

The first thing is when I was using MAMP, I upgraded PEAR from 1.9.0 to 1.9.1 (to install PHPUnit later) with reference from this post. It worked well for me with the phpunit command. I also have Xcode4 but removed it few weeks ago (I mention this because I don't know what could be the cause for all my troubles).

然后,当我尝试在Snow Leopard上使用默认的Apache和PHP时,我意识到Mac上可能有两个版本的PHP.

Then, when I try to use default Apache and PHP on Snow Leopard, I realise that there're likely two versions of PHP on my Mac.

当我尝试撤消php -i命令时,第一个是5.3.3:

The first one is 5.3.3 when I try to revoke php -i command:

    PHP 5.3.3 (cli) (built: Aug 22 2010 19:41:55)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

第二个是5.3.4,当我使用phpinfo()运行文件或调用此php-config --version命令时,它实际上会显示出来.请查看下面的屏幕截图:

The second one is 5.3.4, that actually shows up when I ran a file with phpinfo() or invoke this php-config --version command. Please see the screenshot below:

================================================ ========================

=========================================================================

我的另一个问题是使用 PECL 安装 xdebug .您可以从上面的php -i命令中看到的是来自Komodo的预编译的xdebug.so(我读了这篇文章),而不是每次我尝试安装xdebug时PECL所安装的内容,都会出现以下错误:

Another problem for me is installing xdebug using PECL. What you can see from php -i command above is a pre-compiled xdebug.so from Komodo (I read this post), not what was installed by PECL as each time I try to install xdebug, these errors appear:

ngocminh@MBP[447]:~$ cd /usr/local/pear/bin/
ngocminh@MBP[448]:bin$ sudo ./pecl install xdebug
downloading xdebug-2.1.1.tgz ...
Starting to download xdebug-2.1.1.tgz (303,198 bytes)
..............................................................done: 303,198 bytes
66 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize' failed

在为他们整天上网之后,对这些混乱一无所知.请帮我弄清楚.如果您愿意,请随时向我询问更多详细信息.谢谢!!!

Have no idea about these mess after a whole day surfing the Internet for them. Please help me figure it out. Please do not hesitate asking me for more details if you want. Thank you!!!

- which php

ngocminh@MBP[449]:bin$ which php
/usr/bin/php

推荐答案

出于某些原因,我建议您坚持使用MAMP

I recommend you stick with MAMP for several reasons

  1. Apple的软件更新可能会破坏您对操作系统级别的PHP和MySQL所做的自定义.

  1. Software updates from apple may destroy the customizations you have done to your OS level versions of PHP and MySQL.

MAMP可以轻松停止,因此只会在需要时消耗系统资源.

MAMP can be easily stopped and thus will only consume system resources when needed.

对MAMP的更改不太可能影响系统的其他任何部分

It is less likely that changes to MAMP will effect any other parts of your system

您没有说明进行切换的任何原因,因此使您自己不必要的头痛,并且可能只是为了回到已经使用MAMP的地步

You didn't indicate any reason for switching so you are causing yourself unnecessary headache and work just to possibly get back to a point where you already are with MAMP

我使用Komodo二进制文件通过MAMP运行XDebug.我建议您进行同样的操作,除非有理由通过PECL安装您自己的软件. 这篇文章如果您需要从命令行访问php,则可能与您有关.

I use the Komodo binaries to run XDebug through MAMP. I would recommend doing the same unless there is a reason to install your own through PECL. This post may be relevant to you if you need to access php from the command line.

这篇关于Mac OS Snow Leopard&上的两个PHP版本.使用PECL安装xdebug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 18:55