NuSphere Corporation
Support Services
Overview
KB
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
Technical FAQ
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla Development
Learn PHP
<Security Q&ARun debug session>
Last updated: Sat, 27 Mar 2010

HOWTO: Install debugger module



Important notes
  • Debugger module for php is a php extension that should be installed on the same machine where you're running php
  • You need a web server with PHP properly configured. Follow these instructions on how to install php. If you don't have a web server for the development purpose, you can use SRV web server that comes with NuSphere PhpED IDE
  • PHP and PHP debugger (dbg) are already installed for local debugging with SRV web server
  • Debugger modules for all supported platforms are in %PROGRAMFILES%\NuSphere\PhpED\debugger\server
  • All web servers (including Apache and IIS) capable of running PHP, are supported for debugging php. List of supported platforms is available
  • If you want to debug in NuSphere PhpED IDE either locally or remotely, you can quickly setup php debuger using Project Settings Wizard. It will check php and debugger installation, help configuring them, test the results, and suggest what to do in case of problems.
It's possible to install debugger module with Project Settings Wizard help or without it.

Installing the debugger using Project Settings Wizard (guided installation)

1. Start NuSphere PhpED IDE
2. If you don't have projects, please create one
3. Open Project -> Project Properties dialog and click Settings Wizard button
4. Proceed with Project Settings Wizard. It will inspect your php and web server configuration, and suggest how to isntall debugger, then check the debugger functionality.

Installing the debugger without Wizard (manual installation)

PREPARE
1. PHP should be installed and properly configured (see this page for instructions on how to install PHP)
2. Create a simple script shown below and run it using your favorite html browser
<?php phpinfo();?>

3. Locate path to php.ini listed in phpinfo's topmost header. This file will be needed in steps 4, 5.3, and 6 below
4. Make sure extension_dir shown in phpinfo page is not ./ otherwise please set extension_dir to have an absolute path. For example "c:\php5\ext" under Windows or "/usr/lib/php5/modules" under unix.

INSTALL
5. Install debugger module
5.1. Find php debugger module for the target platform in %PROGRAMFILES%\NuSphere\PhpED\debugger\server directory, for example C:\Program Files\NuSphere\PhpED\debugger\server\Windows or C:\Program Files\NuSphere\PhpED\debugger\server\Linux for Windows and Linux respectively. You will find many debugger modules in tar balls for various platforms. Please see "Debugging PHP on various platforms" for the table of all supported platforms and the corresponding debugger modules.
5.2. Copy selected module into extension_dir directory on the server.
5.3. Depending on the platform and "thread safe" status of your php, add either of the following lines into php.ini:
zend_extension=/usr/lib/php5/modules/dbg-php-5.2.so
or
zend_extension_ts=c:\php5\ext\dbg-php-5.2.dll

Notes:
  • this line should appear before any other zend_extension(s).
  • "5.2" in the module name means it's intended for php version 5.2. For the other version, you have to select corresponding modules.
  • Starting with version 5.3, php does not support zend_extension_ts anymore. You have to use zend_extension for both ThreadSafe and non-safe versions of PHP.

CONFIGURE
6. Add the following debugger settings to php.ini
[debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=host1 host2 host3
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16

Notes:
  • host1 host2 and host3 are host names or IP addresses of development machines allowed to start debug sessions. If you run debugger through SSH tunnel, you have to add only localhost.
  • DBG version 2 (free) does not support debugger.hosts_allow, debugger.hosts_deny or debugger.ports settings

CHECK
7. Restart web server (you have to restart IIS Admin service if you're using IIS)
8. Launch phpinfo and check the output. Make sure that the topmost header contains:
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies with DBG v3.8.x, (C) 2000,2010, by Dmitri Dmitrienko
9. It's recommended to check the results using Project Settings Wizard


<Security Q&ARun debug session>
Last updated: Sat, 27 Mar 2010