Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo versions of PHP on Mac OS Snow Leopard & Installing xdebug using PECL
    primarykey
    data
    text
    <p>I was using <strong>MAMP</strong> (standard) for PHP Development for some times before I read some posts about built-in Apache/PHP on <strong>Snow Leopard</strong>. I decided to shift to those I am provided with but seems to have many problems.</p> <p>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 <a href="https://serverfault.com/questions/184741/upgrading-pear-from-1-9-0-to-1-9-1-fails">this post</a>. It worked well for me with the <code>phpunit</code> 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).</p> <p>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.</p> <p>The first one is 5.3.3 when I try to revoke <code>php -i</code> command:</p> <pre><code> 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 </code></pre> <p>The second one is 5.3.4, that actually shows up when I ran a file with <code>phpinfo()</code> or invoke this <code>php-config --version</code> command. Please see the screenshot below:</p> <p><img src="https://i.stack.imgur.com/KVJVe.jpg" alt="PHP file with phpinfo()"></p> <p>=========================================================================</p> <p>Another problem for me is installing <strong>xdebug</strong> using <strong>PECL</strong>. What you can see from <code>php -i</code> command above is a pre-compiled xdebug.so from Komodo (I read <a href="http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard" rel="nofollow noreferrer">this post</a>), not what was installed by PECL as each time I try to install xdebug, these errors appear:</p> <pre><code>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 </code></pre> <p>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!!!</p> <p><strong>--EDIT 1:</strong> <code>which php</code></p> <pre><code>ngocminh@MBP[449]:bin$ which php /usr/bin/php </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload