gibney.org : Technology : Programming : PHP : XDebug


just a logo :)

search:


See as: raw | code

terms of service | imprint

gibney.org
is powered by m1d1





XDebug
(Entry Nr. 305, by user 1 | edit)

XDebug is great. It lets you step through your code

1) Get xdebug.so


This is probably the hardest part. Go here: www.xdebug.org, get the code, compile and phpize it.

2) Put xdebug.so somewhere.


I put it here: /etc/php5/apache2/

3) Put this in your php.ini


(on my system it is in /etc/php5/apache2/ as well)
zend_extension="/etc/php5/apache2/xdebug.so"
xdebug.remote_enable=1

4) Restart Apache



5) Check phpinfo()


If xdebug is there, it will be mentioned

6) Update Vim


apt-get install vim-python

7) Get the Vim DBGp client



http://www.vim.org/scripts/script.php?script_id=1929

There are 2 files inside the zip. Put them here:
/usr/share/vim/vim70/plugin/

8) Start Vim and hit F5



9) Reqeust a Page


Like this: http://servername/index.php?XDEBUG_SESSION_START=1

10) Step through the code!


Go to Vim and hit F2 or F3 to step through your code.
There are some infos on which keys to press in one of the windows.
Very useful is F12 - it shows you the value of the variable under the cursor.
Also good to know: type this in vim: :set mouse=a and you will be able to use the mouse to set the cursor and to resize windows.
Create a new entry at this position