Warning: You're looking at a styleless page because your browser is ignoring CSS styles. You're probably using a very old browser, or you disabled CSS support by purpose. We suggest you to download a modern browser such as Firefox or Internet Explorer.

Debugger (with DBG) (PHPEdit < 3.0)

Internal Web Server Configuration

Internal Web Server mode uses four components - PHP, dbg, dbg Listener, and PHPEdit. It has the advantage of not requiring a web server to operate. On a typical installation of PHPEdit, no further programs need to be installed, and all configuration can be done from the IDE.

Configuring PHPEdit

  1. Open the debugger settings dialog box, by choosing Debug > Debugger Setting from the menu bar.
  2. In the Debugger > DBG Listener section, IP Address should be left blank. Set Port to 7,869.
  3. In the Debugger > Server page, CGI PHP executable should be left at the default setting, normally C:\Program Files\WaterProof\PHPEdit\ <<Your PHPEdit version>> \php\php-cgi.exe.
    If PHP was not installed along with PHPEdit, or if the user wishes to use a different version of the PHP CGI executable, this setting should be set to the location of php-cgi.exe. If the defaults setting is not used, PHP and dbg will need to be manually installed and configured using the instructions in the HTTP Configuration section below.
  4. Configure PHPEdit in internal web server mode.

External Web Server Configuration

External Web Server mode uses five main components - web server, PHP, dbg, dbg Listener, and PHPEdit. External Web Server mode can be used on one machine, or on two. Using two machines places the web server, PHP, and dbg on the server machine, while dbg Listener and PHPEdit are on the client machine.

For these instructions it is assumed that the web server is Apache HTTP Server with PHP 5.1.2 installed. It is also assumed that the user has installed and configured Apache and PHP correctly, as those installations are beyond the scope of this document.

To test installation it is recommended to create a php file called info.php that contains the following:

<?php echo phpinfo(); ?>

One machine (Windows only)

Using one machine is the most secure way of testing your scripts, and the most convenient method for editing. However, since most websites are hosted on Linux/Unix based machines, this may not represent the most accurate testing environment.

Installing dbg

[PHP install directory] is typically c:\php or c:\php5
[PHP ini path] is most commonly c:\windows

  1. Download dbg from http://dd.cron.ru/dbg/downloads.php
  2. From that zip, extract i386\php_dbg.dll.5.1.2 into [PHP install directory]\ext\
  3. Rename [PHP install directory]\ext\php_dbg.dll.5.1.2 to [PHP install directory]\ext\php_dbg.dll
  4. Edit [PHP ini path]\php.ini and add the following to the section labeled Windows extensions:
    extension=php_dbg.dll
  5. Verify that the following line is in php.ini, or add if necessary:
    extension_dir = "[PHP install directory]\ext"
  6. Add the following to the end of php.ini:
    [debugger]
    debugger.enabled = true
    debugger.profiler_enabled = true
    debugger.JIT_enabled = true
    debugger.JIT_host = clienthost
    debugger.JIT_port = 7869
  7. Restart Apache. View info.php in the browser. It should contain a reference to dbg in the text near the Zend logo. It also should contain a dbg section in the configuration portion.

Configuring PHPEdit

[PHP install directory] is typically c:\php or c:\php5

  1. Open the debugger settings dialog box, by choosing Debug > Debugger Setting from the menu bar.
  2. In the DBG Listener section, IP Address should be left blank. Set Port to 7,869.
  3. Configure PHPEdit in external Web Server mode : Use an external server should be checked, and External server is on a remote machine should be unchecked.
  4. Set the HTTP Server root URL to http://localhost/
  5. Local Root directory should be the path to the web directory for localhost (ex. c:\apache\htdocs)

Two Machines

When using two machines, PHPEdit and dbg Listener will always be on a Windows machine. Apache, PHP, and the dbg module may be on either another Windows machine, or a Linux machine. Care must be taken to configure dbg to only connect to trusted clients. Otherwise, important information about the code could be exposed to the public.

Windows

Installing dbg

Perform the following steps on the server.

[PHP install directory] is typically c:\php or c:\php5
[PHP ini path] is most commonly c:\windows

  1. Download dbg from http://dd.cron.ru/dbg/downloads.php
  2. From that zip, extract i386\php_dbg.dll.5.1.2 into [PHP install directory]\ext\
  3. Rename [PHP install directory]\ext\php_dbg.dll.5.1.2 to [PHP install directory]\ext\php_dbg.dll
  4. Edit [PHP ini path]\php.ini and add the following to the section labeled Windows extensions:
    extension=php_dbg.dll
  5. Add the following to the end of php.ini:
    [debugger]
    debugger.enabled = true
    debugger.profiler_enabled = true
    debugger.hosts_allow=host1 host2 host3 
    debugger.hosts_deny=ALL
    The debugger.hosts_allow setting should contain the IP addresses of all of the client machines that will be allowed to debug the scripts.
  6. Restart Apache. View info.php in the browser. It should contain a reference to dbg in the text near the Zend logo. It also should contain a dbg section in the configuration portion.
Configuring PHPEdit

Perform the following steps on the client.

[PHP install directory] is typically c:\php or c:\php5

  1. Open the debugger settings dialog box, by choosing Debug>Debugger Setting from the menu bar.
  2. In the DBG Listener section, IP Address should be left blank. Set Port to 7,869.
  3. Configure PHPEdit in external Web Server mode : Use an external server should be checked, as well as External server is on a remote machine and The remote operating system is Windows .
  4. Set the HTTP Server root URL to the root URL of the server (ex. http://www.example.com/ ot http://example.com/~user/)
  5. Local Root directory should be the location of the local copy of the scripts. (ex. c:\projects\example\)
  6. Remote Root directory should be the location of the scripts on the server. (ex. c:\apache\htdocs\)

Note: If the server and client are running on the same network it may be convienant to map the server's root directory to a network drive. For instance, if the server's root directoy is \\Server\apache\htdocs\ and it is mapped to drive z:, the setting for Local Root directory would be z:\. When set up this way, changes to the local copies opened by the debugger will modify the scripts directly on the server. Without this network drive mapping, after editing a script, it must be uploaded to the server before further debugging.

Linux/FreeBSD

Installing dbg

Perform the following steps on the server.

[PHP extension directory] is typically /var/php/extensions

  1. Download the correct version of dbg for your version of Linux/FreeBSD from http://dd.cron.ru/dbg/downloads.php
  2. From that archive, extract i386/dbg.so-5.1.2 into [PHP extension directory]
  3. Edit /etc/php.ini (on some installations this file may be in a different directory) and add the following:
    extension=dbg.so-5.1.2
    [debugger] 
    debugger.enabled=on 
    debugger.profiler_enabled=on 
    debugger.hosts_allow=host1 host2 host3 
    debugger.hosts_deny=ALL 
    debugger.ports=7869, 10000/16
    The debugger.hosts_allow setting should contain the IP addresses of all of the client machines that will be allowed to debug the scripts.
  4. Restart Apache. View info.php in the browser. It should contain a reference to dbg in the text near the Zend logo. It also should contain a dbg section in the configuration portion.
Configuring PHPEdit

Perform the following steps on the client.

[PHP install directory] is typically c:\php or c:\php5

  1. Open the debugger settings dialog box, by choosing Debug>Debugger Setting from the menu bar.
  2. In the DBG Listener section, IP Address should be left blank. Set Port to 7,869.
  3. Configure PHPEdit in external Web Server mode : Use an external server should be checked, as well as External server is on a remote machine , however The remote operating system is Windows should be unchecked.
  4. Set the HTTP Server root URL to the root URL of the server (ex. http://www.example.com/ ot http://example.com/~user/)
  5. Local Root directory should be the location of the local copy of the scripts. (ex. c:\projects\example\)
  6. Remote Root directory should be the location of the scripts on the server. (ex. /var/www/)

Note: If the server and client are running on the same network and the server is running samba, it may be convienant to map the server's root directory to a network drive. For instance, if the server's root directoy is \\sambaserver\var\www\ and it is mapped to drive z:, the setting for Local Root directory would be z:\. When set up this way, changes to the local copies opened by the debugger will modify the scripts directly on the server. Without this network drive mapping, after editing a script, it must be uploaded to the server before further debugging.