Configuring VS.Php for debugging

VS.Php is designed so that it requires minimal configuration for debugging Php applications. We understand that it is very important to get quickly up and running with Php. We include a pre-configure web server with Php 4 and Php 5 with XDebug and DBG to facilitate debugging. This is what we refer as the built-in engine. This is the default mode for debugging. Simply create a Php project, add a Php script, select the page as the start up page and hit F5.

Often developers would like to use their existing web server for debugging. This could be a local IIS or Apache server, or an external server. No matter where the server is, as long as the server can contact your workstation you will be able to debug your scripts.

Debug configuration settings


Configuring a project for debugging has the following basic settings:

  • Debug mode

    Select from built-in mode to use VS.Php apache/php server or select external mode to use your own web server.

  • Debugging type

    Select Php/Javascript if you want to debug the server and the client at the same time. The browser must be IE for this to work. Or select just Php to tell VS.Php not to attach the debugger to the browser process.

  • Debugging engine

    Select between XDebug and DBG. If you are using Php 5, we recommend you to use XDebug. If you use Php 4, we recommend you to use DBG.

  • Start Page

    This option is only available when using built-in debug mode. This is the name of the page in your project that will be used to start the debug session. You can select this page by using the solution explorer. Right click on the page you want and select start page.

  • Start Url

    This option is only available when using external debug mode. Enter the url you want to start (E.G. http://localhost/index.php). It is important to understand that this starting page maps to one of the files in your project. Learn more about mapping remote files.

  • Browser type

    You have two options, Internet Explorer or your default browser (Firefox, etc).

Advance debug configuration settings


The following are more advanced debug settings for those looking for more customization in the debugger behavior.

  • Built-in category


    • php.ini path

      You can tell VS.Php to use your custom php.ini file rather than the one that comes with VS.Php built in engine

    • Apache port number

      When the VS.Php launches the built-in Apache server, it picks a unused port. You can tell VS.Php which port number to use. Make sure noone is using that port number or Apache will fail to start and the debug session will be terminated.

    • Apache configuration template

      VS.Php comes with an Apache configuration template that uses to generate a config file for your project. It stores the project specific file as .httpd.conf in the project diretory. You can create your own template for VS.Php to use. VS.Php template is located in the VS.Php diretory and its named httpd-template.conf.

  • General category


    • Debugclient port number

      You can customize the port number XDebug and DBG uses to contact your workstation. This port number must be reachable from the server. The default is 7870.

    • DBG client host

      This is the host name we pass to DBG in the query string to tell it where to connect for debugging. By default, the value is clienthost. DBG interprets this as use the IP address of the http request to connect back. In most scenarios you don't need to modify this value.

      XDebug does not use this setting because the client host address must be configured in the php.ini.

asmithmd1 says:

leaving the port number at 0 does not work, you must pick an unused port number for Apache to start

juanc says:

If you leave it empty then it works. I'm going to update the screenshot.

Thanks