Skip to end of metadata
Go to start of metadata

Here is how I installed Eclipse's PHP Development Tools (PDT) plugin on Fedora 7 here.

If you start Package Manager after a fresh installation of Fedora 7 from DVDYou, you may find that Eclipse is listed in the Development category. The Eclipse is version 3.2. I have tried to install PDT with it. I was not able to make remote debugging work.

The installation includes:

  1. Install Sun Java (JRE or JDK)
  2. Install PHP Development Tools
  3. Install Zend Executable Debugger
  4. Install Zend Debugger Server

Install Sun Java (JRE or JDK)

Intenet resources:
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=8390

0. Check you current installation of Java. You do not need to do this, but I think it is better to do so.

[root@fedora ~]$ java -version

You will get information like this:

java version "1.5.0"
gij (GNU libgcj) version 4.1.2 20070502 (Red Hat 4.1.2-12)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

1. Download Sun Java Runtime Environment or Java Development Kit (SE) from:
http://java.sun.com/javase/downloads/index.jsp
I downloaded JDK 6u1 and Java Runtime Environment (JRE) 6u1. I tried both JRE and JDK, but you do not need to install both of them. Only one of them is fine. I installed with self-extracting RPM file. To install Java on Fedora 7 you must be root.

2. Install JRE or JDK with self-extracting RPM file. Replace "jdk-6u1-linux-i586-rpm.bin" with "jre-6u1-linux-i586-rpm.bin" in the following, if you are installing JRE.

  • Go into the directory where the downloaded file saved.
  • Set the file as executable.
  • Run the self-extracting RPM file
  • You should find a /java directory.
  • Go back to root's home direcotry.

3. Configure JRE or JDK on Fedora 7. Replace "jdk1.6.0" with "jre1.6.0", if you are installing JRE.

  • Remove file `/var/lib/alternatives/java':
    You will see:
    rm: remove regular file `/var/lib/alternatives/java'?
    
    Press "y" and enter.
  • Create new alternatives file for java:
  • Configure the system to use Sun's Java
    You will see:
    There are 2 programs which provide 'java'.
    
      Selection    Command
    -----------------------------------------------
       1           /usr/lib/jvm/java-1.5.0-gcj/bin/java
    *+ 2           /usr/java/jdk1.6.0_01/bin/java
    
    Enter to keep the current selection[+], or type selection number:
    
    Press "enter" to continue.
    If you see "*+" sign is not in the line where "/usr/java/jdk1.6.0_01/bin/java" is in, then input the number of the line where "/usr/java/jdk1.6.0_01/bin/java" is in.
  • Display Java configuration information of your system.
    You should see:
    java - status is manual.
     link currently points to /usr/java/jdk1.6.0_01/bin/java
    /usr/lib/jvm/java-1.5.0-gcj/bin/java - priority 1
    /usr/java/jdk1.6.0_01/bin/java - priority 2
    Current `best' version is /usr/java/jdk1.6.0_01/bin/java.
    
  • Create or edit /etc/profile.d/java.sh file.
    Enter the following and save the file.
    export JAVA_HOME="/usr/java/jdk1.6.0_01/bin"
    export JAVA_PATH="$JAVA_HOME"
    export PATH="$PATH:$JAVA_HOME"
    
  • Then type in:
  • Check Java executable directory on your system:
    you should see:
    /usr/bin/java
    
  • Check Java version on your system:
    you should see:
    java version "1.6.0_01"
    Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
    

Then, the installation of Sun's Java is completed.

Install PHP Development Tools

If you are installing PDT all-in-one package, please skip this part.
You can find the latest PDT all-in-one package from Eclipse PDT project download page.

Internet resources:
http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_PDT
(This is just a reference. Remember, some information on this page are not correct.)

Eclipse can be installed for any user, you need not to be root to install Eclipse and PDT.

1. Download Eclipse SDK 3.3 from:
http://download.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/linPlatform.php#EclipseSDK

I used Linux (x86/GTK 2) versions. File name: eclipse-SDK-3.3-linux-gtk.tar.gz

2. Install Eclipse SDK 3.3.

[zhaonx@fedora ~]# tar -vxf ./Download/eclipse-SDK-3.3-linux-gtk.tar.gz ./

3. Install PDT plugin.

  • Start Eclipse SDK:
  • Click "Help->Software Updates->Find and Install ...", you will see the "Install/Update" window.
  • Click "Search for new features to install" and then "Next".
  • Click "New Remote Site ...", and input "PHP Development Tools" (or any other text you want) as "Name", and "http://download.eclipse.org/tools/pdt/updates/" as the URL. Click "OK".

    Unknown macro: {html}

    <DIV align="center">Figure 1: Add PDT remote site</DIV><BR></BR>

  • Check "Europa Discovery Site" and "PHP Development Tools", and click "Finish". It is not necessary to check "The Eclipse Project Updates".
  • On the next window, click the triangle besides "PHP Development Tools", and check "PDT features". You will see a message says that "org.eclipse.wst(2.0.0)" is required.

    Unknown macro: {html}

    <DIV align="center">Figure 2: wst 2.0.0 is required</DIV><BR></BR>

  • Click the triangle besides "Europa Discovery Site" to expand its item list. Then, click "Select Required" button; all required feature plugins will be automatically selected for installation.

    Unknown macro: {html}

    <DIV align="center">Figure 3: All required features have been selected</DIV><BR></BR>

  • Click "Next" and wait till the feature license window comes out. Click "I accept the terms in the license agreement", and then click "Next".
  • On the next window, you will see a list of all features that will be installed; click "Finish". You will see the Update Manager downloading files.
  • When the "Feature Verification" window appears, click "Install All".
  • Eclipse will start installing all the selected features. When the installation is completed, you will be asked to restart Eclipse. Click "Yes" to restart it.

Now, the installation of PDT is completed!

Install Zend Executable Debugger

Internet resources:
http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_the_Zend_Debugger

1. Start Eclipse:

[zhaonx@fedora eclipse]# ./eclipse &

2. Click "Help->Software Updates->Find and Install ...". On the "Install/Update" window, click "Search for new features to install" and then "Next".

3. Click "New Remote Site ...", and input "Zend Executables" (or any other text you want) as "Name", and "http://downloads.zend.com/pdt" as the URL, and click "OK".

Unknown macro: {html}

<DIV align="center">Figure 4: Add "Zend Executables" remote site</DIV><BR></BR>

4. On the next "Install/Update sites to visit" window, select "Zend Executables" ONLY. DO NOT select "PDT features" or "PHP Development Tools". Then, click "Finish".

Unknown macro: {html}

<DIV align="center">Figure 5: Select "Zend Executables" only</DIV><BR></BR>

5. On the next "Updates/Search results" window, select "Zend Debugger Features" ONLY. Do not select "PDT Features". Then, click "Next".

Unknown macro: {html}

<DIV align="center">Figure 6: Select "Zend Debugger Features"</DIV><BR></BR>

6. On the next "Install/Feature License" window, select "I accept the terms in the license agreement"; click "Next".

7. On the next window, click "Finish". When the "Feature Verification" window appears, click "install all". When ask to restart Eclipse, click "Yes" to restart Eclipse.

The installation of "Zend Executables Debugger" is completed.

Install Zend Debugger Server

Internet resources:
http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_the_Zend_Debugger

You need to do the following as root.

1. Download "Zend Debugger server" from Zend website at:
http://downloads.zend.com/pdt/server-debugger/

I downloaded ZendDebugger-5.2.6-linux-glibc21-i386.tar.gz.

Update on Dec. 16, 2008

Icon

The latest version of the debugger server is 5.2.14.

2. Unpack this Debugger server file.

[root@fedora Download]# tar -xvf ZendDebugger-5.2.6-linux-glibc21-i386.tar.gz

A new directory named "ZendDebugger-5.2.6-linux-glibc21-i386" will be created.

3. Find the directory of PHP extension.

create a PHP file with the following code; name it as phpinfo.php, and save it in a directory that is accessible through your website. For example, I saved my phpinfo.php file in the document root directory: /var/www/html/.

<?php
print_r (phpinfo());
?>

Load this phpinfo.php page in firefox by inputing proper URL. For example, I input "http://localhost/phpinfo.php" as the URL in firefox. Search for "extension_dir", and you will be able to find the directory of PHP extension.

Unknown macro: {html}

<DIV align="center">Figure 7: Location of PHP extension</DIV><BR></BR>

4. Copy the proper ZendDebugger.so file to PHP extension directory. For example,

[root@fedora Download]# cp ./ZendDebugger-5.2.6-linux-glibc21-i386/5_2_x_comp/ZendDebugger.so /usr/lib/php/modules

5. Find the directory of php.ini file.

Load the phpinfo.php page in firefox as mentioned above. Search for "Configuration File (php.ini) Path", and you will be able to find the location of php.ini file.

Unknown macro: {html}

<DIV align="center">Figure 8: Location of php.ini file</DIV><BR></BR>

6. Open the php.ini file and add the following code at the end of the file.

[Zend]
zend_extension=/usr/lib/php/modules/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1/32, 192.168.0.0/16
zend_debugger.expose_remotely=always

7. Search for "implicit_flush" in the php.ini file, and set its value to "on".

implicit_flush = On

8. Search for "output_buffering" in the php.ini file, and set its value to "0".

output_buffering = 0

9. Search for "eaccelerator.enable" in the php.ini file, and set its value to "0", if it is installed and enabled.

eaccelerator.enable = 0

10. Disable Xdebuger or DBG Debugger if they are installed.

11. Save the php.ini file and restart apache.

[root@fedora Download]# httpd -k restart

Reload phpinfo.php in firefox again, you will find the "with Zend Debugger" information.

Unknown macro: {html}

<DIV align="center">Figure 9: Zend Debugger server has been installed</DIV><BR></BR>

Now, the installation of Zend Debugger server is completed.

  • No labels

2 Comments

  1. Very helpful. Thanks for all the details and screenshots.

  2. This article helped me a lot.
    I am using Fedora 7 and Windows XP. I had very less knowledge on Java version and setting up of JRE and JDK.
    I was trying to Install eclipse PDT without checking the Java version.

    The problems i faced are
    In Windows XP(with Java 1.4)
    PHP Percpective was not visible.

    In Fedora 7(default java)
    PHP percpective was opening but Most of the features were not working.

    I searched in google like
    "Eclipse pdt not working",
    "Eclipse -clean"
    "Eclipse PDT javascript editor not opening"
    and so on to fix this problem(never looked the java version in my system ).

    Finally i got a link to this article and the Problem solved. Now Eclipse PDT M2 is working in both Fedora 7 and Microsoft XP (smile)

    Thanks to Nathan