I wanted to do it so I can step through some code one of my clients have prepared.
I found that in general it was hard to set up debugging, but it sure saves you a ton of time while troubleshooting. Anyways it seems that the installation guide provides you with 80% of what you need, but leaves 20% out.
Note that the installation instructions are for Ubuntu 12.10
To get the first 80%: Follow install instruction located below
http://xdebug.org/docs/install
To get the last bit working: I came across a few issues.
First was that php cli didn't see xdebug. This isn't a problem if you're using the apache php, but to complete and not run into problems in the future, solve this problem paste the following a new file /etc/php5/conf.d/xdebug.ini
; xdebug debugger
zend_extension="/usr/lib/php5/20100525/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
PHP will automatically scan that conf.d directory and pick up the config.
Restart apache, and check that phpinfo() has the correct info.Do a Ctrl + A and paste it into checker wizard: http://xdebug.org/wizard.php
Make sure there aren't any problems with it.
The second issue was related to my IDE. I was using PHPStorm and you actually have to create a server first by going to File -> Settings -> PHP -> Servers, and adding a new Server. Put localhost and port 80. After those two additions it now works like a charm!
No comments:
Post a Comment