views:

45

answers:

2

Hi folks, I've been scouring every resource I could find, but came up empty. I get the dreaded "Waiting for Connection" message in NetBeans 6.9 when I start a debug session. After much reading, most folks are able to get phpinfo() to display that it loaded the xdebug module. Not so with me.

I downloaded the source through SVN using this call

svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug

I switched to the xdebug directory and then ran phpize on the source

sudo /Applications/MAMP/bin/php5/bin/phpize
Password:
grep: /Applications/MAMP/bin/php5/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:        
Zend Module Api No:     
Zend Extension Api No:  

A big fat nothing! The referenced directories don't even exist. So, I make the assumption that any .ini tweaking I do beyond this point is useless. If I do a whereis php, I find it in /usr/bin. That's the default php pre-loaded with the OS. I don't want that one. I need to use the php installed with MAMP. I cannot believe how insanely frustrating it is to get this thing working!

For the record, my xdebug section in my php.ini looks like this:

[xdebug]
    ; xdebug config for Linux and Mac OS X
    zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.idekey="netbeans-xdebug"
    xdebug.profiler_enable=1
    xdebug.profiler_output_name=xdebug.cachegrind-out.%s.%p
    xdebug.remote_log="/Applications/MAMP/logs/xdebug_log.log"

It's a mish-mash of many different attempts to get xdebug to work. So, I don't know which pieces are valid or not.

I throw myself on the mercy of the experts because I obviously am not one of them. I have absolutely no idea how to proceed at this point.

Thanks in advance.

A: 

I just started working with xdebug myself due to problems with PHP 5.3.1. I had used PECL per instructions a couple weeks ago but it looks like phpize is the new black. I looked over the new instructions (generated from my phpinfo()) @ http://xdebug.org/find-binary.php

this is of note:

Run: phpize

As part of its output it should show:

Configuring for:
PHP Api Version:         20090626
...
Zend Extension Api No:   220090626
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

2 things:

  1. have you checked that phpize is up to date?

  2. if that doesnt work try these instructions: http://xdebug.org/docs/install

ebt
I've narrowed it down to this. Phpize found in my MAMP path will not work correctly. I apparently got the source to compile using the /usr/bin/phpize. Everything looked fine. I restarted MAMP, ran phpinfo() and... nothing! When I run php-config --version from CLI, I get --version [5.3.1]. The MAMP phpinfo() says PHP Version 5.2.11, and xdebug, not surprisingly, is not found in the output.So, as I said originally, it was the pre-loaded php that helped compile xdebug, not MAMP.My problem still exists. Thanks for the lead, though.
Mike
+1  A: 

To use phpize in the MAMP directory instead of your system path, you should add MAMP's directory for PHP binaries to your $PATH. Below I'm using MAMP 1.9.1, which offers PHP 5.2 and PHP 5.3. We'll assume you're compiling for PHP 5.3.

Open or create ~/.bash_profile and put the following contents:

#Add MAMP binaries to path
export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.3/bin:$PATH"

You may also need to chmod the binaries inside /Applications/MAMP/bin/php5.3/bin to be executable:

chmod 755 /Applications/MAMP/bin/php5.3/bin/pear
chmod 755 /Applications/MAMP/bin/php5.3/bin/peardev
chmod 755 /Applications/MAMP/bin/php5.3/bin/pecl
chmod 755 /Applications/MAMP/bin/php5.3/bin/phar
chmod 755 /Applications/MAMP/bin/php5.3/bin/phar.phar
chmod 755 /Applications/MAMP/bin/php5.3/bin/php
chmod 755 /Applications/MAMP/bin/php5.3/bin/php-config
chmod 755 /Applications/MAMP/bin/php5.3/bin/phpcov
chmod 755 /Applications/MAMP/bin/php5.3/bin/phpize

Restart your Terminal session for the new $PATH to be loaded. Run the command which phpize and it should display /Applications/MAMP/bin/php5.3/bin/phpize. If not, the path to phpize in your MAMP directory is not being loaded in your $PATH. Use echo $PATH in Terminal to make sure /Applications/MAMP/bin/php5.3/bin is in the $PATH.

To get xDebug to compile, you need the header files from when PHP was compiled. These are available on the MAMP website in a DMG, and called "MAMP Components": http://www.mamp.info/en/downloads/index.html

Unpack MAMP Components and copy MAMP_src to your Desktop. Unpack MAMP_src/php-5.3.2.tar.gz and move it into the include path present in php-config --includes which should include /Applications/MAMP/bin/php5.3/include/php.

cd ~/Desktop/MAMP_src
tar -xvzf php-5.3.2.tar.gz
mkdir -p /Applications/MAMP/bin/php5.3/include
mv php-5.3.2/ /Applications/MAMP/bin/php5.3/include/php

You can now run phpize in the xDebug source dir.

John Kary