Mediawiki debugging

From Biowikifarm Metawiki
Revision as of 13:49, 11 January 2013 by Gregor Hagedorn (Talk | contribs)

Jump to: navigation, search

Installing xdebug

With xdebug it is possible to get detailed debugging information from parsed php scripts if the slightest error message is reported by php, i.e. error notice. Install it as follows:

# install xdebug
sudo pecl install xdebug

This downloads and compiles xdebug and creates some output/version messages. To activate xdebug, you finally have to add the following link path in the php.ini file and restart:

# edit php.ini with nano
sudo nano /etc/php5/apache2/php.ini
; xdebug extension (installed Mon Mar  7 23:38:32 CET 2011)
zend_extension= "/path/to/lib/xdebug.so"
# let nginx/apache read the php.ini anew:
 sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart

Now with each notice error message a detailed debugging information is given.

Uninstalling xdebug

(1) Remove the linked xdebug.so library path in php.ini:

sudo nano /etc/php5/apache2/php.ini
; remove/comment out in /etc/php5/apache2/php.ini
; zend_extension= "/path/to/lib/xdebug.so"
# let apache/nginx read the php.ini anew:
 sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart

(2) The uninstall works the same way as the install does:

# uninstall xdebug
sudo pecl install xdebug