简体   繁体   English

Mac OS Snow Leopard上的两个版本的PHP和使用PECL安装xdebug

[英]Two versions of PHP on Mac OS Snow Leopard & Installing xdebug using PECL

I was using MAMP (standard) for PHP Development for some times before I read some posts about built-in Apache/PHP on Snow Leopard . 在我阅读有关Snow Leopard内置Apache / PHP的一些帖子之前,我曾经使用MAMP (标准)进行PHP开发。 I decided to shift to those I am provided with but seems to have many problems. 我决定转向我提供的那些,但似乎有很多问题。

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 . 第一件事是当我使用MAMP时,我将PEAR从1.9.0升级到1.9.1(稍后安装PHPUnit),参考这篇文章 It worked well for me with the phpunit command. 使用phpunit命令对我来说效果很好。 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). 我也有Xcode4,但几周前将它删除了(我之所以提到这一点,是因为我不知道造成我所有麻烦的原因是什么)。

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. 然后,当我尝试在Snow Leopard上使用默认的Apache和PHP时,我意识到我的Mac上可能有两个版本的PHP。

The first one is 5.3.3 when I try to revoke php -i command: 当我尝试撤销php -i命令时,第一个是5.3.3:

    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

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. 第二个是5.3.4,当我用phpinfo()运行文件或调用这个php-config --version命令时实际显示。 Please see the screenshot below: 请看下面的截图:

PHP文件与phpinfo()

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

Another problem for me is installing xdebug using PECL . 对我来说另一个问题是使用PECL安装xdebug 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: 从上面的php -i命令可以看到的是来自Komodo的预编译的xdebug.so(我读过这篇文章 ),而不是每当我尝试安装xdebug时PECL安装的内容,这些错误都会出现:

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!!! 谢谢!!!

--EDIT 1: which php --EDIT 1: which php

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

I recommend you stick with MAMP for several reasons 我建议你坚持使用MAMP有几个原因

  1. Software updates from apple may destroy the customizations you have done to your OS level versions of PHP and MySQL. 来自apple的软件更新可能会破坏您对操作系统级别的PHP和MySQL所做的自定义。

  2. MAMP can be easily stopped and thus will only consume system resources when needed. MAMP可以很容易地停止,因此只在需要时消耗系统资源。

  3. It is less likely that changes to MAMP will effect any other parts of your system 对MAMP的更改不太可能影响系统的任何其他部分

  4. 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 你没有指出任何转换的原因,所以你造成了不必要的麻烦,工作只是为了可能回到你已经和MAMP在一起的地步

I use the Komodo binaries to run XDebug through MAMP. 我使用Komodo二进制文件通过MAMP运行XDebug。 I would recommend doing the same unless there is a reason to install your own through PECL. 我建议你做同样的事情,除非有理由通过PECL安装你自己的。 This post may be relevant to you if you need to access php from the command line. 如果您需要从命令行访问php, 这篇文章可能与有关

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在默认的Mac OS X Leopard捆绑PHP配置上安装/启用PHP Pecl Intl扩展 - Installing/enabling PHP Pecl Intl extension on a default Mac OS X Leopard bundled PHP configuration 无法在Mac OS X Snow Leopard上获得pecl memcached为XAMPP构建32位版本 - Can't get pecl memcached to build 32 bit version for XAMPP on mac os x Snow leopard mac雪豹下mamp上安装和使用ffmpeg - installing and using ffmpeg on mamp under mac snow leopard 在Snow Leopard上使用XDebug for Drupal 6.14吗? - Using XDebug for Drupal 6.14 on Snow Leopard? 在 Mac OS 10.6 (Snow Leopard)、10.7 (Lion)、10.8 (Mountain Lion) 上激活 PHP 和 MySQL 的最简单方法? - Easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)? php.ini.default在Mac OS X Snow Leopard上未找到Cloudfusion的新路径 - php.ini.default not finding new path to cloudfusion on Mac OS X Snow Leopard 在 Mac OS 上的 Dockerized PHP 中使用 XDebug - using XDebug in a Dockerized PHP on mac OS 当我在Mac上使用本地服务器时,我在哪里保存我的HTML和PHP文件(OS X 10.6 Snow Leopard) - Where do I save my HTML and PHP files when I am using a local server on my Mac (OS X 10.6 Snow Leopard) 在OS X Lion的XAMPP上使用PECL安装PHP Enchant - Installing PHP Enchant using PECL on XAMPP on OS X Lion 使用PECL OS在Ubuntu上安装PDO_MYSQL在PHP 5.1.6上 - Installing PDO_MYSQL on PHP 5.1.6 using PECL OS: Ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM