Mac OS X Leopard, Entropy PHP and XDebug Extension (64bit)

By Xeon Xai  

As all my entension in PHP must be compiled in 64bit to load into PHP, I’ve decided to give the details on how I added xdebug to Entropy PHP 5.2.5 beta 6 on Mac OS X Leopard running on an Intel Core 2 Duo.

First, download the source code for xdebug at the following site

XDebug (source code [2.0.4 as of this writing])

Then unpack the file into a directory someone on your system.

From the terminal, go to the folder where you unpacked everything. It should be xdebug-2.0.4. Then type the following commands:

  • cd xdebug-2.0.4
  • phpize
  • MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp” CCFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe” CXXFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe” LDFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load” ./configure –enable-xdebug
  • make

Now wait for it to complete the compiling process.  When it is done, begin these commands:

  • cd modules
  • chown root:wheel xdebug.so
  • sudo mv xdebug.so /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/
  • cd /usr/local/php/php.d
  • sudo pico 50-extension-xdebug.ini

In the text editor, type the following line, then save the file with Control-O (WriteOut), then exit, Control-X.

zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so

Once you’ve save the file and returned back to the terminal you can type in the following to restart Apache2:

  • sudo apachectl graceful

To make sure all went well, type in this to see if Xdebug is showing in the PHP information.

  • php -v

Should display something like this.

PHP 5.2.5 (cli) (built: Jan 24 2008 00:33:14)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans

If the Xdebug v2.0.4 line shows up, then you’ve succesfully installed the 64bit version of Xdebug for Entropy PHP in Mac OS X Leopard.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

3 Comments

  1. Posted October 16, 2009 at 5:06 PM | Permalink | Reply

    Just a reminder not to do cut and paste from the web page, I tried your command, and it failed, because the double-quotes on the page are not actual double-quotes.

    Replacing them, the command worked fine:

    MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp” CCFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe” CXXFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe” LDFLAGS=”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load” ./configure –enable-xdebug

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. Posted November 8, 2009 at 6:59 PM | Permalink | Reply

    And by the way, the hyphen in front of -enable-xdebug isn’t a real hyphen either!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. Posted November 8, 2009 at 7:10 PM | Permalink | Reply

    All compiled OK, moved to the right directory, php.ini edited appropriately, but xdebug.so simply doesn’t show up on the PHP info.

    Any ideas as to how to debug further?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Post a Comment

Your email is never shared. Required fields are marked *

*
*