Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

Complete guide to installing X-Debug on MacOS X

I have been surviving without X-Debug for a long time (I still don't know how I do it, so don't ask me how). Almost everyone who uses X-Debug can't remember how they got it to work on their box so I decided to pen this down so if I need to go through this route again I won't be found wandering.

Follow the following steps and you would be alright:

1. Get your PHP version first... open your terminal and type


php -version

2. Install your X-Debug with brew, run this if your php version is 5.6.*


brew install php56-xdebug

**if your php version is 5.4 install php54-xdebug**

3. When through, you will have something close to the screenshots below

if you miss this info you can get it back by typing this in your terminal brew info php56-xdebug

4. the next thing is for you to get where the .so file is. The .so file is here /usr/local/opt/php56-xdebug/. You can see from the screenshot

5. Ensure that you know the php you are using, type this which php to know which one. The purpose of this is to know the php.ini to edit.


which php

6. Copy this and paste in your php.ini


[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=On
xdebug.profiler_append=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir="/tmp"
xdebug.auto_trace=0
xdebug.trace_enable_trigger=1
xdebug.trace_format=1
xdebug.trace_output_dir="/tmp"
xdebug.max_nesting_level=200
xdebug.idekey=PHPSTORM

Make this xdebug.idekey your idekey, most people use PHPSTORM, it all depends on your choice.

7. Restart your web server and check your php info to confirm if the X-Debug extension has been loaded. You can type this php -i | grep xdebug in your terminal to quickly see your xdebug extension info.


php -i | grep xdebug


comments powered by Disqus