This Sticky Note explains how to set up Zend Debugger on Linux. The procedure applies to most distributions with PHP (and Apache) installed. For most steps you will probably need the superuser account.
1. Inspect the phpinfo() output of the server on which you want to install the Zend Debugger (or run
php -i if you want to install Zend Debugger for the CLI version of PHP).
Click on the picture to see it without scroll bars:

- phpinfo() after the installation
- pre-a.png (130.04 KiB) Viewed 69826 times
You need the following information:
(1) The PHP version (PHP CLI -
PHP Version => 5.2.9),
(2) The location of the php.ini file (PHP CLI -
Loaded Configuration File => /etc/php5/cli/php.ini), or
(3) The additional .ini files directory (PHP CLI -
Scan this dir for additional .ini files => /etc/php5/conf.d).
(V) Make sure that Thread Safety flag is disabled (PHP CLI -
Thread Safety => disabled), there is no Thread Safe version of Zend Debugger for Linux.
(!) Note if you use the Zend Extension Manager (PHP CLI -
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies). The Zend Extension Manager can be installed as part of the Zend Optimizer installation.
2. Download Zend Debugger from the
Zend Studio Downloads page. Select
Studio Web Debugger and choose one of the Linux packages: 32-bit or 64-bit.
The following is a representation of the archive hierarchy (there is a Zend Debugger binary for all recent PHP versions):
- Code: Select all
ZendDebugger-5.2.14-linux-glibc23-<architecture>/
4_3_x_comp/
ZendDebugger.so
4_4_x_comp/
ZendDebugger.so
5_0_x_comp/
ZendDebugger.so
5_1_x_comp/
ZendDebugger.so
5_2_x_comp/
ZendDebugger.so
dummy.php
md5
Inventory.xml
README
3. Create a new directory for Zend Debugger where it can be read by Apache (I will use
/opt/Zend in this Sticky Note). In this directory create a sub-directory for your version of PHP –
/opt/Zend/php-5.2.x (in my example PHP version is 5.2.9 – see screenshot
(1)). The latter is obligatory if you use Zend Extension Manager, but won't hurt in other cases too.
- Code: Select all
mkdir -p /opt/Zend/php-5.2.x
4. Unpack the relevant version of Zend Debugger into
/opt/Zend/php-5.2.x:
- Code: Select all
tar xf ZendDebugger-5.2.14-linux-glibc23-i386.tar.gz -C /opt/Zend/php-5.2.x --strip-components=2 --wildcards *5_2_x_comp*
Now the PHP configuration needs to be modified to load Zend Debugger. In most current Linux distributions, there is a php.ini file and a directory that contains more .ini files, each containing a piece of PHP configuration. I believe that creating a separate file for Zend Engine extensions is more convenient than modifying php.ini itself. Therefore, in my example I'll create a separate
zend.ini file (you can name it differently). For most users this may have an additional advantage – while many distributions have separate php.ini files for the web server's PHP and PHP CLI, the configuration directory is the same for both. Thus, this zend.ini file will affect both PHPs.
5. Open the configuration file (php.ini or zend.ini) for editing. Here are the paths for some Linux distributions:
openSUSE:- PHP (see screenshot (2)) – /etc/php5/apache2/php.ini
- PHP CLI – /etc/php5/cli/php.ini
- configuration directory (see screenshot (3)) – /etc/php5/conf.d
Ubuntu:- PHP – /etc/php5/apache2/php.ini
- PHP CLI – /etc/php5/cli/php.ini
- configuration directory – /etc/php5/apache2/conf.d (actually a symlink to /etc/php5/conf.d)
Fedora:- PHP and PHP CLI – /etc/php.ini
- configuration directory – /etc/php.d
6. Depending on whether you use Zend Extension Manager (see screenshot
(!)), the following lines must be added to the configuration file.
Without Zend Extension Manager:- Code: Select all
# The section name is optional, but it's always a good idea to add it,
# especially if you are not using a separate file
[Zend]
# This directive needs the full path to the Zend Debugger binary
zend_extension =/opt/Zend/php-5.2.x/ZendDebugger.so
With Zend Extension Manager:- Code: Select all
# The section name is optional, but it's always a good idea to add it,
# especially if you are not using a separate file
[Zend]
# This directive instructs Zend Extension Manager to load Zend Debugger.
# Note that the path given is only the top of the hierarchy.
# Zend Extension Manager adds to this path the running PHP version
# in the form "/php-5.2.x/" and the name of the binary file "ZendDebugger.so".
zend_extension_manager.debug_server = /opt/Zend
7. An additional change needs to be made to allow Zend Studio to communicate with Zend Debugger. You need to specify your Zend Studio machine IP address (or network) in the allowed hosts list. Note that the network mask must be specified in CIDR notation, for example:
255.0.0.0 = /8
255.255.0.0 = /16
255.255.255.0 = /24
255.255.255.248 = /29
255.255.255.255 = /32 (exact match)
- Code: Select all
# This directive allows Zend Debugger to start a debug session with:
# 127.0.0.1/32 – Zend Studio on the same computer
# 192.168.0.1/32 – Zend Studio on a computer with IP address 192.168.0.1
# 10.0.0.0/8 – Zend Studio on any computer with IP starting with 10.
zend_debugger.allow_hosts=127.0.0.1/32,192.168.0.1/32,10.0.0.0/8
# This directive allows Zend Debugger to expose itself
# upon request (this is used in some service functionality).
# The possible options are:
# never – do not expose (default)
# always – expose to whoever wants to know
# allowed_hosts – expose only if the request comes from an IP listed above
zend_debugger.expose_remotely=always
8. Save the configuration file and restart Apache.
9. Check the phpinfo() output and ensure the following:
- Zend Debugger is listed in the Zend Engine section.
- The Zend Debugger section exists.
- The values of
zend_debugger.allow_hosts are correct.
- The value of
zend_debugger.expose_remotely is correct.
Click on the picture to see it without scroll bars:

- phpinfo() before the installation
- res-a.png (85.76 KiB) Viewed 69810 times
10. Copy
dummy.php from the downloaded Zend Debugger package to your server's document root. It should be accessible from a web browser as
http://example.com/dummy.php (this script does not produce any output, but it should not result in the 404 error):
openSUSE:- Code: Select all
tar xf ZendDebugger-5.2.14-linux-glibc23-i386.tar.gz -C /srv/www/htdocs --strip-components=1 --wildcards *dummy.php
Ubuntu:- Code: Select all
tar xf ZendDebugger-5.2.14-linux-glibc23-i386.tar.gz -C /var/www --strip-components=1 --wildcards *dummy.php
Fedora:- Code: Select all
tar xf ZendDebugger-5.2.14-linux-glibc23-i386.tar.gz -C /var/www/html --strip-components=1 --wildcards *dummy.php
Known IssueZend Debugger may not load, crash or produce errors when used in conjunction with some other Zend Engine extensions. The most common examples are Zend Optimizer, Zend Loader, ionCube Loader and XDebug. For Zend Optimizer or Zend Loader it is recommended to use Zend Extension Manager, which will fix these compatibility issues. In case of ionCube Loader and XDebug make sure that Zend Debugger is loaded after these extensions. The loading order is defined by the order of corresponding directives in the configuration files. Therefore, the best approach is to add Zend Debugger directives at the very end of php.ini.