How to enable XDebug extension on my php?

I run php on macbook pro where the mountain lion runs. Mountain Lion comes preloaded with XDebug, so based on the tutorial I found, I took three steps. First I will uncomment this line in my php.ini:

zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" 

Secondly, I uncommented this line in my php.ini:

 xdebug.remote_enable=1 

And finally, I restarted the Apache server using

 sudo apachectl restart 

The problem is that I don't see xdebug appearing in my php details when I run phpinfo (). Thanks.

PS: The path to the above xdebug.so file is correct.

+6
source share
3 answers

I answer my question because Mountain Lion is a special case when it comes to launching XDebug.

As you can see here, the mountain lion has an older xdebug.so library. Therefore, the user must recompile the library.

Here's how to do it.

  • Download the latest version here. (We get the file under source .)
  • Unzip the downloaded file using tar -xvzf xdebug-2.2.1.tgz
  • Run cd xdebug-2.2.1
  • Run phpize
  • Run ./configure
  • Run make
  • Run sudo cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20090626
  • Restart the web server using sudo apachectl restart
+7
source

Verify that you are editing the same php.ini that appears in phpinfo () in broswer.

Here are my settings (I'm also on a Macbook Pro on Mountain Lion by the way):

 xdebug.var_display_max_children = 999 xdebug.var_display_max_data = 99999 xdebug.var_display_max_depth = 100 ;zend_extension_ts=php_xdebug.dll xdebug.remote_enable=On xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp 

It works for me. Does it help?

+1
source

This set of instructions worked for me.

It successfully uses OSX Mountain Lion's native Apache2 and XDebug along with MacGDBp and a Safari extension called XDebug Helper .

+1
source

All Articles