Lists common issues with debugger to shoot troubles quickly. In case you didn't find an answer here, please feel free to ask on our Support forum.
Run following script:
<?php phpinfo(); ?>
Check whether Xdebug extension is loaded. The correct output is depictured bellow.
php.iniis matching settings in your Visual Studio (
Tools | Options | PHP Tools | Advanced).
- Ensure you're using PHP Web Project, not ASP.NET Web Site. You can convert web to the PHP project from menu.
Using WAMP Server
WAMP setup installs its own PHP configuration. To use WAMP installation with PHP Tools, setup Custom Server in your project properties and ensure php.ini corresponding to your WAMP server is configured properly. PHP Tools do not check for php.ini in WAMP installation.
Most Common Issues
Browser Opens an Empty White Page
Ensure first loaded page is syntax error free, and there are no two functions with the same name. Debugger does not handle parse error on the entering script.
I get message in output window: "There wasn't established any directory mapping. Debugging most likely won't work correctly."
Make sure the file you are requesting as first one is included in your project. Automatic mapping mechanism requires that file is part of the project in order to map it correctly.
I can't get the debuger to work. I'm running Zend Framework, is that a known issue?
No, there are just few things that has to be configured in order to be able to debug the Zend framework application with Xdebug:
Make sure ZendExtensionManager loads after Xdebug (switch the order in
php.ini); or comment it out completely.
Turn off zend_optimizer.
While using quick watch, watch or immediate window, debugging stops working
There is a known issue with Xdebug causing debugging session to stop working for the current request. You have to be using
set_error_handler() function to catch errors and to use quick watch, watch or immediate window to evaluate an expression throwing an error. This combination makes Xdebug unusable for the rest of the request.
As a workaround it is recommended to not call
set_error_handler() in your code when debugging.
More at xdebug.org/docs/faq.
Stepping through code works, but PHP exceptions are not thrown in Visual Studio
xdebug.default_enable directive and make sure it's set to 1 (this is default value).
Debugger won't work when "Don't open a page. Wait for a request from an external application" is set in the project settings.
The problem has to do with the fact that Xdebug is expecting a GET initialization string to be supplied in the URL request. The solution to this problem would be to intruct Xdebug to start debug session by opening your project in browser with
?XDEBUG_SESSION_START=1 query string or add
xdebug.remote_autostart = 1
php.ini file in Xdebug configuration section which will force it to start on every request.