Skip to end of metadata
Go to start of metadata

This weblog a record of the process that I installed and configured PHP Development Tools (PDT) and PHPEclipse. This part has three sections:

  1. Installing and Configuring Java on CentOS 5
  2. Installing and Configuring PDT with Zend Debugger server
  3. Installing and Configuring PHPEclipse with DBG

The Internet resources that I referenced will be listed at the beginning of each section.

I think it is necessary to list some information of my CentOS 5 system.

Kernel: 			2.6.18-8.1.6.e15
Apache: 			v. 2.2.3
PHP: 				v 5.1.6
Server Document root: 	        /var/www/html
Server URL: 			http://localhost/

I worked as root to test the installation.

Installing and Configuring Java on CentOS 5

Internet resource:

Java Runtime Environment (JRE) is required to run Eclipse, because it is written in Java. According to PDT User Guide, "Java 2 (J2RE 1.4.2+) is required to run both Eclipse and PDT".

To check if Java is intalled on CentOS 5,

The following message or similar may be shown:

java version "1.4.2"
gij (GNU liggcj) version 4.1.1 20070107 (Red Hat 4.1.1-52)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO

It indicates that Java has been installed on your CentOS 5. However, this version of Java does not work for Eclipse. You will sure get Java errors when you use Eclipse. When you check the error log file (<path to your workspace>/.metadata/.log), you will find the detail information of the error.

Unknown macro: {html}

<DIV align="center">Figure 1. Eclipse Starts up Error with GNU Java</DIV>

The reason is that the default Java in CentOS is a GNU version, it is not a real Java. Eclipse requires a REAL Java; SUN Java is highly recommended. Fedora 7 comes with 1.5.0 version of GNU Java, and still does not work properly with Eclipse.

First, of course, you need to download SUN Java Run Time (or JDK). I used JRE SE 6.

If you are installing from RPM package, then follow the instruction on this page:

But NOT the instruction on this page:

Why? Because the later one is NOT correct. The "rpm.bin" file will first create "jre-6<version>-linux-i586.rpm" file, and then AUTOMATICALLY run proper "rpm" command to install JRE. You DO NOT NEED to run

Further, the "rpm.bin" file will install java into "/usr/java" directory, no matter in which directory you run the file (i.e., I run the "rpm.bin" file in /root/Download/ directory).

Lastly, you need to configure SUN Java as the default Java for your system. I recommend to follow the steps provided in Help with Java installation. This help is in detail and very easy to follow. I will not repeat it here.

Installing and Configuring PDT with Zend Debugger server

Internet resources:

I was only able to make PDT work properly on CentOS 5 with all-in-one package. Thus, I will only write down the process of installing PDT with all-in-one package. I was able to install PDT successfully with Eclipse SDK3.3 on Fedora 7. The installation process is available here.

I used automated installation method to install PDT and Zend Executable Debugger Eclipse Plugin. Following are the steps that I took to install PDT and Zend Debugger server. It has three steps:

  1. Download and install all-in-one package
  2. Install Zend Executable Debugger Eclipse Plugin
  3. Install Zend Debugger server

1. Download and install all-in-one package

The all-in-one package that I used is pdt-all-in-one-S20070611_M1-linux-gtk.tar.gz. Download this file from:, and save it in /root/download direcotry; then start a terminal window and do the following (please do not input anything starting from "//" they are just comments I add):

cd /root/download                     //go into the directory where
                                      //the downloaded all-in-one package file is saved.

tar -vxf pdt-all-in-one-S20070611_M1-linux-gtk.tar.gz
//unpack the all-in-one file. "eclipse" directory will be created.

mv eclipse /root/             //move eclipse directory from /root/download/ to /root/.
cd /root/eclipse              //go to eclipse directory
./eclipse &                   //start eclipse program

2. Install Zend Executable Debugger Eclipse Plugin

With Eclipse window, click "Help->Software Updates->Find and Install...". On the window, click and "Search for new features to install", and then click "next".

Unknown macro: {html}

<DIV align="center">Figure 2: Feature Updates</DIV>

Click "New Remote Site"; enter "Zend Executable" (or anything you want) in the first text box, and "" in the second text box, and click "OK".

Unknown macro: {html}

<DIV align="center">Figure 3: Add New Update Site - Zend Executable</DIV>

Then, click "Finish" and wait till the following window appears, and click the triangle, and select "Zend Debugger Features" ONLY. DO NOT SELECT "PDT Features"!! Click "Next".

Unknown macro: {html}

<DIV align="center">Figure 4: Select "Zend Debugger Feature" Only</DIV>

On the next window, click "I accept the terms in the licence agreement"; then click "next".

Unknown macro: {html}

<DIV align="center">Figure 5: Accept the License Agreement</DIV>

Next, click "Finish", and then you will see "Update manager" window. Wait till the installation verification window appears and click "Install".

Unknown macro: {html}

<DIV align="center">Figure 6: Finish Preparing Zend Debugger Features Installation</DIV>

Unknown macro: {html}

<DIV align="center">Figure 7: Update Manager Downloading Zend Debugger Features</DIV>

Unknown macro: {html}

<DIV align="center">Figure 8: Verify Installation of Zend Debugger Features</DIV>

When the installation is completed, the installation process will ask to restart Eclipse. Click "yes" to restart eclipse.

When Eclipse restarted, you can check if "Zend Executable Debugger Eclipse Plugin" has been properly installed. If everything goes smoothly, you will be able to see Figure 5 in the "Difficulties in Installing and Configuring PDT and PHPEclipse" section of My Experiences of Installing PHP IDEs on CentOS.

3. Install Zend Debugger server

The final step is to install Zend Debugger server. This step includes several sub-steps. You need to do the following as root.
1). Create a phpinfo.php file (or what ever name you want to use) with the following code:

place it anywhere that you can load it as a web page. I placed it in /var/www/html/.

2). Load the phpinfo.php file in firefox; search for "Extension_dir" text in the web page to find the location of PHP Extension directory. For my CentOS 5, it is /usr/lib/php/modules.

Unknown macro: {html}

<DIV align="center">Figure 9: Location of PHP Extension Directory</DIV>

3). Download Zend Debugger Extension Binary from Zend downloads. I downloaded ZendDebugger-5.2.6-linux-glibc21-i386.tar.gz.

4). Unpack the file and copy the proper "" file to PHP Extension directory.

tar -vxf ZendDebugger-5.2.6-linux-glibc21-i386.tar.gz
//unpack downloaded file. ZendDebugger-5.2.6-linux-glibc21-i386 directory will be created.

cd ZendDebugger-5.2.6-linux-glibc21-i386               //go to the newly created directory

cp ./5_1_x_comp/ /usr/lib/php/modules
//copy the right file to PHP extension dircotry. If your have upgraded your PHP to 5.2.x,
//then use the file in 5_2_x_comp directory.

5). Search "Configuration File (php.ini) Path" in phpinfo().php page to find the location of php.ini. Mine is /etc

Unknown macro: {html}

<DIV align="center">Figure 10: Location of php.ini File</DIV>

Then, open the php.ini file; and search for "implicit_flush", and set it to "On".

; this is to see output while debugging
implicit_flush = On

6). In the php.ini file, search for "output_buffering" and set its value to "0" if it is not.

; this is to see output while debugging
output_buffering = 0

7). Add the following lines in the php.ini file. (I placed them at the end of my php.ini file)

zend_extension=/usr/lib/php/modules/        //full path to your PHP extension directory

8). Disable eAccelerator if it is installed and enabled in the php.ini file.


9). Copy the file named dummy.php from ZendDebugger-5.2.6-linux-glibc21-i386 directory to the server's document root directory.

cp dummy.php /var/www/html

10). Restart apache server.

httpd -k restart

Now, the installation of PDT is completed. If the installation is successful, then you will be able to see Zend Debugger version information like in Figure 10 in your phpinfo.php webpage after you reload the page.

Unknown macro: {html}

<DIV align="center">Figure 11: Zend Debugger Sever is Installed</DIV>

You can write a short PHP code to test if both local debugging and remote debugging work.

Installing and Configuring PHPEclipse with DBG

Internet resources:

I will not talk about installing and configuring PHPEclipse with DBG in detail here for two reasons. First, there are two very good documents about the installation and configuration of PHPEclipse. Second, as I mentioned earlier, I was not able to make PHPEclipse work properly, especially I can not make local debugger work. However, there are something that I think need to address here.

First, unlike the last comment said on this page, Eclipse SDK 3.1.2 is actually available at Eclipse website. Following is the URL where you can find Eclipse SDK 3.1.2.

Second, I only made Eclipse SDK 3.1.2 + PHPEclips 1.1.8 work for remote debugging. However, in fact, I was even unable to make remote debugging work at first. I searched Internet and found this How I got PHPEclipse + the DBG debugger working on Windows page. Then I changed the content of

Unknown macro: {html}


entry of my php.ini file to the following to make remote debugging work. Here is my

Unknown macro: {html}



debugger.ports=7869, 10000/16
;debugger.JIT_enabled=on      //This line does not affect debugging!

Third, I think PHPEclipse is not convenient to use in terms of remote debugging, because you have to start debugging process in PHPEclipse environment first; then switch to your web browser and entering an URL that looks like the following:


and then switch back to PHPEclipse environment again.

Last comment:
From these years' experiences of using Linux and Windows, I have to admit that installing and configuring software in Linux is really more difficult than in Windows.

  • No labels