How to install Zend Debugger on CentOS

Zend Debugger provides step-by-step debugging and lets monitor the current values of variables in scope. It can save hours for complex applications instead of using echo after each line to see what is going on.

The installation is relatively simple, but not very well documented and could get tricky if you don’t know what to look for.

First download Studio Web Debugger and follow the instructions in the README.txt file on how to set it up. You will need to extract a file and add couple of lines to your /etc/php.ini file.

Once this is done, restart apache and test if loads correctly

service httpd restart
php -v

You should see a message similar to the one bellow:

PHP 5.3.3 (cli) (built: May  7 2012 20:13:47)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies

but you may get one of the following two errors:

Failed loading /usr/lib64/php/ cannot open shared object file: No such file or directory


Failed loading /usr/lib64/php/ cannot open shared object file: No such file or directory

CentOS includes those libraries version 10 or 1.0.0. Type locate to find their location, which should be in /usr/lib64/ directory. If those libraries are not found you will need to install openssl

Yum install openssl

Once you located and, create a symbolic link like so:

ln -s /usr/lib64/ /usr/lib64/
ln -s /usr/lib64/ /usr/lib64/

Run php -v again to make sure it is working. At this point you can start debugging unless you have SELinux enabled.

Troubleshooting SELinux related errors

If you run CentOS with SELinux enabled you will get one of the following two error messages if you search /var/log/httpd/error_log for ie

grep /var/log/httpd/error_log
Failed loading /usr/lib64/php/  /usr/lib64/php/ cannot enable executable stack as shared object requires: Permission denied


Failed loading /usr/lib64/php/  /usr/lib64/php/ cannot restore segment prot after reloc: Permission denied

Run the following two commands to solve the above errors in respective order:

setsebool -P httpd_execmem on

The above flag enables the webserver to access and execute code in memory, which required by ZendDebugger, but blocked by SELinux as in production environment this behaviour is normally of malicious nature.

The next command will fix the second error caused by incorrect context labelling.

chcon -t textrel_shlib_t /usr/lib64/php/

The last thing we need to do is to run the following command which will allow the webserver (httpd) to communicate with external services over the network.

setsebool -P httpd_can_network_connect on

You are all done. Happy debugging!

Notes on installing Zend Debugger on cPanel/WHM Server

The installation process if the same as installing the debugger on CentOS with exception to different file locations.

Location of php.ini file:


cPanel server will already have openssl with and libraries, so you can link those instead

ln -s /usr/lib/vmware-tools/lib64/ /usr/lib64/
ln -s /usr/lib/vmware-tools/lib64/ /usr/lib64/

You may also want to change




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


# gab 2013-08-24 06:45
Thanks a lot, you saved me hours
# stephen 2014-03-26 01:27
Thanks , it is helpful .


Would you like to contribute?

Free business joomla templates