![]() You can add breakpoints by clicking the line number in the editor’s margin and then pause execution on them. Step out – Step out of the current function.Step into – Step into the function (for non-built-in functions).Step over – Step over the currently executing line.There are some other useful actions in the debugging toolbar. To trigger the debugger you must pass XDEBUG_SESSION_START as a request parameter (GET/POST) or XDEBUG_SESSION as a cookie parameter. ![]() Notice in the brower’s URL bar the XDEBUG_SESSION_START parameter. From there you can continue to the next break point using the continue button. Otherwise, it will run until it encounters the first breakpoint. It will open up the application in a browser, and PHP’s execution will pause at the first line of the file if you have enabled the “Stop at first line” option in the Options window. With your source file open, press the Debug button in the toolbar to start debugging. Now you’ll be able to run the debugger by clicking Debug in the tools tab. Enter the debugging port given in php.ini and a Session ID which you’ll need to pass with the requests you want to debug. Open the options window (Tools > Options) and go to the debugging tab for the PHP section. You can easily configure Netbeans to act as an Xdebug client. Then you can inspect the variables’ values in that scope to get better insight into what PHP is doing. Xdebug overcomes this by letting you pause your application’s execution where ever you want. But the problem with this approach is that you have to modify the code for debugging you must remember every place you added output statements and remove them after debugging is finished. More often than not it’s tempting to use the var_dump() and exit/ die() combination for debugging. You can take the output of phpinfo() or php –i and paste it in the text box and have the wizard analyze your server’s configuration and instruct you on how to compile Xdebug for your machine. The Xdebug website provides a simple wizard to guide you through installation. There are other installation options as well. When you use Xdebug, it’s important to make sure you are not using any other Zend extensions since they may conflict with Xdebug. ![]() xdebug.remote_port is the port on which the client listens for a connection from Xdebug (9000 is the default value). xdebug.remote_host is the name or the IP address of your system (here I’ve specified localhost because I’m working all on the same machine, but the value can be an IP Address or a DNS hostname if you need to specify something different for your setup). The xdebug.remote_enable value toggles whether the extension is active or not. Zend_extension specifies the path to the Xdebug module. Zend_extension="/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" The entries for Xdebug in my php.ini look like this: ![]() If you are using a package based installation on a platform such as Ubuntu, you can install it through your package manager with a command like apt-get install php5-xdebug. If you are using XAMPP or MAMP, Xdebug comes preinstalled you just need to enable it in your php.ini. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |