Debuggers are software that have been specifically created for this task: debugging. When you use a debugger, you get a "Swiss Army Knife" array of tools to help you in the task of tracking down the location of, finding and removing the causes of bugs.
For PHP, the debugger is XDebug. It has integrations for all populars IDEs such as Eclipse, Netbeans, PHPStorm, etc.
http://xdebug.org
For easy installation, I would suggest you check out the XDebug Wizard
http://xdebug.org/wizard.php
What it needs is the output from phpinfo()
Just create a simple checkinfo.php file with just
<?php
phpinfo();
Paste it into the form on the XDebug Wizard page. Customized installation instructions would be provided. For the binary library file for Xdebug, I have found that most installations of PHP already have the XDebug binary included, but it just needs you to uncomment the php.ini file to activate it. For example, I have included the XDebug section for my xampp php.ini (noticed that I uncommented some lines).
The additional line is the one xdebug.remote_port=9000 which is the additional line I added because I am using Netbeans and the default configuration in Netbeans uses 9000 as the debug port. http://xdebug.org/docs/remote
[XDebug]
zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
;xdebug.profiler_append = 0
xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port=9000
xdebug.trace_output_dir = "D:\xampp\tmp"
For more details about using XDebug and Netbeans configuration, please refer to the Netbeans documentation help pages.
http://wiki.netbeans.org/HowToConfigureXDebug
https://netbeans.org/kb/docs/php/configure-php-environment-windows.html#installAndEnableXDebug
For more info on using XDebug refer to
http://devzone.zend.com/1120/introducing-xdebug/
I will be talking more about tracing and neat other things you can do with XDebug later on in another part of this PHP debugging series of posts.
Subscribe to:
Post Comments (Atom)
Github CoPilot Alternatives (VSCode extensions)
https://www.tabnine.com/blog/github-copilot-alternatives/
-
The error message above in the title line indicates that you have some code that takes too long to run in your php file. There is a sanity ...
-
Scilab 5.0.2 installs in windows fine. But when I try to run program, get start-up screen, then an error dialog box . Error message is: Scil...
-
To Build Websites and Apps, People Flock to Coding Classes http://online.wsj.com/news/articles/SB10001424052702304709904579411354120634252...
No comments:
Post a Comment