2009年9月13日星期日

How to setup Netbeans 6.7 PHP debug environment in Ubuntu 8.04

1. Enable personal HTTP directory

1.1 use sudo command to create two symbolic links in /etc/apache2/mod-enabled directory:
sudo ln -s ../mods-available/userdir.conf userdir.conf
sudo ln -s ../mods-available/userdir.load userdir.load

1.2 create HTTP directory in the user's home directory:
makedir public_html

1.3 restart apache web server
sudo /etc/init.d/apache2 restart

1.4 test personal HTTP directory
use web browser to browse http://localhost/~[username]/

2. Enable xdebug

2.1 install xdebug DEB package

2.2 add the following lines in /etc/php5/apache2/php.ini:
zend_extension=xdebug.so
xdebug.remote_enable=on

3. Setup Netbeans PHP project

3.1 enable "copy files from sources folder to another location" and set the folder to user HTTP directory

3.2 in "run Configuration" page, set "Project URL" to user HTTP directory

沒有留言: