我正在使用MAMP在我阅读一些有关内置 Apache/PHP 的文章之前,我已经在 PHP 开发(标准)中使用过一段时间了雪豹。我决定转向那些我提供的但似乎有很多问题的人。
第一件事是当我使用MAMP时,我将PEAR从1.9.0升级到1.9.1(以便稍后安装PHPUnit),参考这个帖子 https://serverfault.com/questions/184741/upgrading-pear-from-1-9-0-to-1-9-1-fails。它对我来说效果很好phpunit
命令。我也有 Xcode4,但几周前删除了它(我提到这一点是因为我不知道我所有麻烦的原因是什么)。
然后,当我尝试在 Snow Leopard 上使用默认的 Apache 和 PHP 时,我意识到我的 Mac 上可能有两个版本的 PHP。
当我尝试撤销时第一个是5.3.3php -i
命令:
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
命令。请看下面的截图:
=================================================== =======================
对我来说另一个问题是安装xdebug using PECL。你可以从中看到什么php -i
上面的命令是来自 Komodo 的预编译 xdebug.so (我读过这个帖子 http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard),而不是 PECL 安装的内容,因为每次我尝试安装 xdebug 时,都会出现以下错误:
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
在为他们上网一整天后,对这些乱七八糟的事情一无所知。请帮我弄清楚。如果您愿意,请随时向我询问更多详细信息。谢谢你!!!
--编辑1: which php
ngocminh@MBP[449]:bin$ which php
/usr/bin/php