Protoeditor

Tutorial

In this section, I will try to walk through the minimal steps needed to get Protoeditor running with PHP 5.0.3, according to the debugger of your choice. This tutorial is valid for Protoeditor versions 0.8 and 0.9 but it might be helpful for older versions as well.

DBG

  • Installation and configuration:

    • Download the DBG 2.13.1 binary package (most recent free version, includes the binary for PHP 5.0.3), or the source package if you want to compile it for your system / PHP version.

    • Copy the file dbg.so-5.0.3 to your PHP extension directory.

    • Add an extension entry in your php.ini file
      Example: extension=dbg.so-5.0.3.

    • Paste the following right bellow :
      [debugger]
      debugger.enabled=true
      debugger.profiler_enabled=true


      More options are supported and can be found in DBG docs / forum.

    • If you are using an HTTP Server, restart it.

    • Finally, check if phpinfo() displays information about DBG.

  • Protoeditor configuration

    • Goto "Settings" -> "Configure Protoeditor". In PHP area, you can set the path to the PHP binary in your system.

    • Set "Default debugger" to DBG.

    If you are using Protoeditor to debug local scripts, you are ready to start debugging. If you wish to debug scripts on HTTP Servers, you need to Configure Protoeditor for remote debugging.

Gubed

  • Installation and configuration

    • Download the package Gubed0.2.2 (last version I know of).

    • Uncompress it on your htdocs ( /var/www/htdocs for instance).

    • Rename Gubed/ServerScripts/localsettings_dist.php to localsettings.php.

    • Edit it and uncomment $gbdDebugServer and $gbdDebugPort.

    You should be able to access in your browser the script StartSession.php that resides in /Gubed/ServerScripts.

    Example: http://localhost/Gubed/ServerScripts/StartSession.php

  • Protoeditor configuration

    • Goto "Settings" -> "Configure Protoeditor". In PHP area, you can set the path to the PHP binary in your system.

    • Set "Default debugger" to Gubed.

    • If you are using Protoeditor to debug remote scripts, set the "StartSession.php path" in Protoeditor's Gubed settings to the relative path of StartSession.php.
      example: /Gubed/ServerScripts/StartSession.php

      Otherwise, you might need to set the "StartSession.php path" to the absolute path of StartSession.php.
      example: /usr/local/apache/htdocs/Gubed/ServerScripts/StartSession.php

    For local script debugging, you are set. If you wish to debug scripts on HTTP Servers, you need to configure Protoeditor for remote debugging.

Xdebug

Note: I'm not sure if there is a problem having DBG and Xdebug entries in the php.ini at the same time. In case you run in to problems, be sure to have only one of them loaded in the php.ini.

  • Installation and configuration

    • Download the Xdebug 2.0.0beta5 source package.

    • Uncompress the package and:
      cd xdebug-2.0.0beta5
      phpize
      ./configure --enable-xdebug
      make

    • run "make install" or copy modules/xdebug.so to your PHP extension dir manually.

    • Add a zend_extension entry to your php.ini:
      Example: zend_extension=xdebug.so

    • Paste the following right bellow :
      xdebug.remote_enable=On

      More options are supported and can be found in Xdebug docs.

    • If you are using an HTTP Server, restart it.

    • Finally, check if phpinfo() displays information about Xdebug.

  • Protoeditor configuration

    • Goto "Settings" -> "Configure Protoeditor". In PHP area, you can set the path to the PHP binary in your system.

    • Set "Default debugger" to Xdebug.

    If you are using Protoeditor to debug local scripts, you are ready to start debugging. If you wish to debug scripts on HTTP Servers, you need to configure Protoeditor for remote debugging.




Configuring Protoeditor for remote debugging (Site Settings)

On "Settings" -> "Configure Protoeditor", you have to setup the Sites configuration. This is where you setup the access to the servers you wish to use when debugging scripts. To add a Site, inform the following entries:

  • Site name: Just any name to identify that configuration.
    Example: home

  • URL : The URL to access the server.
    Example: http://www.serverhost.com
    Optionally you might include the port and following directory paths, such as http://localhost:8080/mysite

  • Remote base dir: The base location of your scripts in the remote server.
    Example: /var/www/htdocs

  • Local base dir: The base location of your scripts in your local machine. This is where the local copy of the content in the remote machine's base dir lies.
    Example: /usr/local/apache/htdocs

  • Default file: Optionally, you can set a default file, useful if your site/application has only one entry point (such as a controller script used in MVC pattern).

  • Debugger: Finally, chose the debugger to be used for this configuration.

Tip: If you are debugging on a local HTTP Server, just set remote and local base dirs to the same place.