HOWTO: Install debugger module
It's possible to install debugger module with Project Settings Wizard help or without it.
- 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.
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)
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
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.
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. Pick correct zend_extension_ts vs zend_extension line to load the module and add it into php.ini:
if the OS is Windows and Thread Safety is enabled and php is 5.2 or an earlier version:
zend_extension_ts="c:\php5\ext\dbg-php-5.2.dll"if the OS is Windows and Thread Safety is disabled or php is 5.3 or above:
zend_extension="c:\php5\ext\dbg-php-5.3.dll"if the OS is UNIX and Thread Safety is disabled or php is 5.3 or above:
zend_extension="/usr/lib/php5/modules/dbg-php-5.3.so"if the OS is UNIX and Thread Safety is enabled and php is 5.2 or an ealier version:
This line should appear before any other zend_extension(s) unless you're using IonCube. In latter case, debugger should be placed below it.
If you run 32bit php (under for example 32bit apache), you have to load 32bit debugger module even though the OS is 64bit.
Starting with version 5.3, php does not support zend_extension_ts anymore.
With this version, you always have to use only zend_extension.
6. Add the following debugger settings to php.ini
debugger.hosts_allow=host1 host2 host3
- 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
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,2011, by Dmitri Dmitrienko
9. It's recommended to check the results using Project Settings Wizard