Saturday, 16 November 2013

Debug php with Netbeans and Xampp

Xampp is one of the best free tool for develop website in localhost.
With Xampp I can use php with Apache module, database with MySQL, transfer file with FileZilla, web java ee with Tomcat. And it is very easy to install, only download from here and install, open and click start modules.

Netbeans is still one of the best free IDE to develop many language (java, c++, php ... )

But if you only install netbeans and run Xampp to code php, you will only run to view result, you will not debug: run, pause, step lines and view changed variables...


Today, I will present how to debug php with Netbeans and Xampp because Xampp was integrated xdebug and easy to config when compare with others way.

I use Netbeans 7.4 and Xampp 3.1.0.

XAMPP
Config php.ini in XDebug area.

[XDebug]
zend_extension = "E:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_port=9000

xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "E:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "E:\xampp\tmp"

tientuts blogger


Netbeans

Go to menu: Tools -> Options and config like this image


And restart Netbeans, Xampp to active debug

No comments:

Post a Comment