Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
Recently, after I backed up my files, I was busy disassembling and building my computers repeatedly,  and installing operating systems repeatedly. I did these repeatedly because I want to build a better computer that I can use with all the parts I have at home to set up a [PHP programming |] environment. 

During the earlier days of PCs, they were not so reliable. Thus, I got the habit of backing up files I worked on everyday. Now, as computers are more reliable than those days, I back up things after each term. I found a very interesting thing: every time when you back up everything, nothing bad will happen; but once you forget to back up your important stuff, something bad must will happen. 

For many reasons, I do not want to use MS Windows system (why? I may talk about this in the future.), I decided to set up a LAMP (Linux, Apache, MySQL, PHP) environment. I had used [Redhat|] series software (Redhat, CentOS, and Fedora) for many years before. Only in last year, because my major works only required me using Word, Excel, and SPSS, I removed Redhat from my computer and used Windows only. Some may thought that I could use Redhat too, as Redhat serious has [OpenOffice|]. Yes, you are right, however, there is a compatibility issue. And, people around me does not use OpenOffice, I have to switch back to MS Windows and MS Office. 

As I am familiar with Redhat system, so I decided to use [CentOS|] or [Fedora|] again for my PHP programming environment. They both are free. However, I also heard of that Ubuntu is very popular nowadays and it is free too. So, I decided to try it too. [Setting up LAMP|#Setting up LAMP] records some of my thoughts and things I learned from this round of installation. 

For PHP programming, I want to use an IDE - Integrated Development Environment, since it provides debugging feature, the most important feature I need. [Seven great PHP IDEs compared|], written by Jack Herrington, introduces another six PHP IDEs besides Zend Studio.  [PHP Editor Review|] maintains a list of PHP programming tools. However, many of them are not IDEs.  If you are wondering what are the advantages of IDE than general programming editor, you may read the first section of Jack Herrington's article. Since cost is an important issue that I need to consider :-(, I decided to use free PHP IDEs. Jack Herrington introduces two free PHP IDEs. They are [PHPEclipse|] and [PHP Development Tools|] (PDT, former name: PHP IDE project), both are based on a general purpose programming IDE - [Eclipse|]. I will first talk about the various [Difficulties in Installing PDT and PHPEclipse|#Difficulties in Installing PDT and PHPEclipse]. Then, I will describe the detail steps of [Installing PDT and PHPEclipses on CentOS]. 

h2. Setting up LAMP
As I do not have a strong computer science background, I really cannot tell how advanced each operating system is from the perspectives of computer science. Thus, I can only tell my general feelings about an operating system, such as if a system is easy to use, the colour and the appearance, etc.  

When I decided to set a LAMP environment on my desktop at home, I also decided to replace Windows XP with Linux on my laptop. As my laptop is a very old one - Compaq Presario 1926 with 320M memory, I tried [Xubuntu|] first when I read "Xubuntu is an official derivative of Ubuntu using the Xfce desktop environment. It is intended for users with less-powerful computers, ..." from the Xubuntu page on [Ubuntu|] website. However, my experience of installing Xubuntu on my laptop was very bad. First, it took much longer time than Ubuntu and Fedora 7 to boot up (using liveCD for each system). Second, the touch pad of my Compaq does not work after installing Xubuntu on the hard drive, even though it works fine with the liveCD. I also tried Ubuntu with my desktop and laptop. I think it's good. However, after the default installation, when I used _vi_, the four arrow keys of my keyboard behaved strangely. My desktop has the same problem too. I know this is because of the keyboard layout setting, but I do not want to spend time on this. Because I am familiar with Redhat series, and I do not like the colour Ubuntu uses (I like blue ;-) ), I finally decided to use Fedora 7 for my very old laptop and my desktop. 

Installing CentOS or Fedora and setting up LAMP environment were very easy. However, there are still a frustration I want to mention. The latest CentOS, CentOS 5, seems have a little problem. When I installed CentOS 5, I always chose packages that I wanted to install instead of the default packages that CentOS automatically provids based on my selection of the package categories. I often took off such package as bluetooth, multimedia, email client, and others, because I either do not have the devices such as bluetooth, or I do not need the program such as multimedia and email client. However, many times when the installation was completed, CentOS showed a D-bus error message when boot up. I do not know which package I took off caused this problem. But, I think this is not appropriate, because CentOS checks the dependencies  after the user chooses packages. That means CentOS should be able to find that this D-bus package is missing and is required by another package, and then should include this package in the installation. The same problem exists in Fedora 6. 

While I was struggling with this problem, I visited [Fedora website|] again and found that Fedora 7 was available. So I downloaded and burned a live cd for my old laptop and a DVD for my desktop. I am really excited by Fedora 7!! Its default theme looks so beautiful and it continues using the colour I love, and it has an awesome name: moonshine!
{html:output=html}<div align="center">Figure 1: Fedora 7 starting up window<br>

{html:output=html}<div align="center">Figure 2: Fedora 7 Background</div>{html}

One awkward thing is that Fedora 7 may show the following error message and boot up very slow after completing the installation. 
ata2.01: failed to set xfermode (error-mask=0x4)
ata2.01: failed to set xfermode (error-mask=0x4)
ata2.01: failed to set xfermode (error-mask=0x4)
ata2.01: failed to set xfermode (error-mask=0x40)
I searched the Internet and found that many users who used Lite-on CD/CDRW or DVD driver encountered this problem. My laptop does not have this problem as it has a LG CD-ROM. Do not be upset! This problem can be very easily solved by updating to the latest kernel (2.6.21-1.3228) that is available immediately after a fresh installation. 

When I used Windows XP before, I created and downloaded many files for my studies. I saved them on a separated NTFS partition. When I installed Fedora, I also wanted to keep and use these NTFS files. It was a problem to access NTFS partition in Linux before. I searched Internet and found the [Linux-NTFS project|]. Followed the link provided in the project, I found the [Personal Fedora 7 Installation Guide|] and was able to install and configure my Fedora 7 to access my NTFS files. I also successfully installed [FirstClass|] client 8.315 on Fedora 7. 

h2. Difficulties in Installing PDT and PHPEclipse

My experience of installing and configuring these two PHP IDEs were very painful. 

PHP Development Tools (PDT) is a PHP development plugin for the Eclipse platform. Its former name is PHP IDE project . The documents of PDT are really very poor. I could not find any documents or any information about the documents of PDT from Eclipse website. I searched Internet many times and found a wiki - [PDT User Guide|]. This wiki provides some useful information. However, many information are still lacking, and some are even incorrect. 

For example, on the [Installing PDT|] page of that wiki, it says that the all-in-one page of PDT includes "Zend Executable Debugger Eclipse Plugin". However, this is NOT true. At least, the file pdt-all-in-one-S20070611_M1-linux-gtk.tar.gz that I downloaded from [Stable Build:S20070611-M1|] page does not include Zend Executable Debugger plugin. 

I can proof this. If Zend Executable Debugger plugin is not included, when you try to debug a PHP program as "PHP Script" (Run->Debug as->PHP Script), Eclipse will show an alter message (Figure 3) and open the "PHP Executables Prefernece" window (Figure 4) and ask you to set up "PHP executable". 
{html:output=html}<div align="center">Figure 3: No PHP Executables Alter</div>{html}

{html:output=html}<div align="center">Figure 4: PHP Executables Preferences Set up window</div>{html}

What is "PHP Executalbe"? I do not know! There is not any document talks about this . I tried to fill in  "/usr/bin/php", but did work. I googled the Internet and found this [Almost too good to be true: Debugging PHP with Eclipse PHP IDE and Zend Debugger on Mac OS X|]. The first item under "Installo-Mania" sub title of this page talks about how to set up "Runtime PHP Executable". I followed that instruction, but could not find "org.zend.php.debug.debugger" string under "eclipse/plugins" directory.  

The fact is that, "Zend Executable Debugger Eclipse Plugin" is NOT included in PDT all-in-one package. You need to install the plugin by yourself! After you installed the plugin, Eclipse will automatically set up "PHP Executable". Then, if you try to debug your program as "PHP Script", Eclipse will not show the alter message and will execute the program. If you have set break points in your debugging, the program will pause at break points and wait for you to resume the execution. 

If "Zend Executalbe Debugger Eclipse Plugin" is installed, the "PHP Executables" preferences window should look like this:
{html:output=html}<div align="center">Figure 5: PHP Executables Settings after Zend Executable being Installed</div>{html}

The second inaccurate information provided on that [PDT User Guide|] wiki is the third item "Now add the PDT project's download site" under the "Automated" section of [Installing PDT|] page. It is impossible to add a new remote site with the URL, if you installed all-in-one package and the "PDT updates" site is already on the sites list. Please see figure 6, and pay attention to the content underlined with red lines. 
{html:output=html}<div align="center">Figure 6: Failure to add PDT as new updates site</div>{html}

In addition, "Callisto Discovery Site" is not on the site list. there is only a "Europa Discovery Site" as shown in Figure 6. 

You may think to install PDT from scratch. I mean, install Eclipse SDK first, then install PDT plugin, and then install Zend Executable Debugger Plugin. However, I failed to install and configure PDT successfully. 

I first downloaded the latest releases version of Eclipse - Eclipse SDK 3.2.2 (This happened before June 25, 2007) . I tried to install PDT plugin following the instruction on the Installing PDT page of the PDT User Guide wiki. The installation process could not continue, because PDT plugin feature requires WST 2.0.0 plugin, but Eclipse SDK 3.2.2 only has WST 1.5.1. I could not continue the installation process. 
{html:output=html}<div align="center">Figure 7: WST 2.0.0 is required to Install PDT on Eclipse SDK 3.2.2</div>{html}

Therefore, I tried with Eclipse SDK 3.3RC4. I was able to install PDT plugin and Zend Executable Debugger Plugin. However, for what ever reason that I could not figure out, remote debugging with Zend Debugger did not work. 

I also tried another way to install PDT and Zend Executable Debugger. I found that PDT feature is also included in Zend Executable Debugger. Therefore, I tried to install Zend Executable Debugger directly after I installed Eclipse SDK 3.2.2. I was able to install PDT and Zend Executable Debugger. However, remote debugging still does not work. I also tried to install PDT and Zend Executable Debugger this way with Eclipse SDK3.3RC4. This time the installation process asked for jem, and the installation was not able to continue.

{html:output=html}<div align="center">Figure 8: JEM is Required to Install Zend Debugger with PDT on Eclipse SDK 3.3RC4</div>{html}

*(While I was writing this weblog(?), I found that SDK3.3 was released after June 25, 2007. I tried to install PDT from Eclipse SDK3.3 on CentOS 5 and Fedora 7. It still did not work properly on CentOS. But, it was very successful on Fedora 7. You can find the detail installation process on [Installing PHP Development Tools on Fedora 7].)*

The installation of PHPEclipse was not successfully at all, even thought it has its own [User Manual|] and a [Using PHPEclipse|] wiki. I could only make remote debugging work with PHPEclipse plugin 1.1.8 installed on Eclipse 3.1.  

I first installed PHPEclipse plugin with Eclipse 3.2. It was failed! I followed the instruction on [Installing PHPEclipse|] and [Installing Debugger|] page to install PHPEclipe plugin and DBG debugger. The processes were easy and successful. I followed the instruction on [PHP Source Level Debugging page|] and added the following line in php.ini file
and following statements in my PHP testing program. 
if (function_exists ("DebugBreak")) {
  DebugBreak ();
The debugging process did not pause at break points if I debugged as local. If I debugged as remote debugging, the process paused after the StartDebug function is call and could not resume execution.

I then tried Eclipse 3.3 and PHPEclipse plugin 1.1.9 as someone on [this blog|] said he had installed successfully. The God did not treated me fairly! :-( I was not able to make it work. Lastly, I decided to use Eclipse 3.1 as the Using PHPEclipse wiki says [Eclipse 3.2 does not work|]. This time, after I changed some settings in the {html}[debugger]{html} entry in php.ini file, I got some good luck. I was able to use the remote debugging feature. However, local debug still could not work. 

h2. Personal Conclusion and Opinions

After spending so many days and suffering these pains, I decided to try [Zend Studio|], which is said as the best PHP IDE, because [Zend|] is the background company of PHP. It is really amazing!!! I have never used a program under Linux that is so so so easy to install and use!! The configuration was so easy that you almost need not to do anything. Some one blamed that Zend Studio 5.5 requires Zend Platform for remote debugging. The fact is that this is NOT true. I AM ABLE to use remote debugger with Zend Studion 5.5 and Zend Server Debugger that was downloaded from [here|]. To install Zend Server Debugger, you may follow this [Installing Zend Debugger server|] instruction on [PDT User Guide|] wiki.
Overall speaking, I think it is very inconvenient to use PHPEclipse. Not only because that I could not make local debugger work, but also that: 1) you need to add a debugging statement in source code; 2) you need to input an "debugging URL" manually in web browser in order to debug. The installation and configuration of PHP Development Tool is easy if using all-in-one package, and debugging in PDT is also convenient. Thus, PDT is good enough for PHP programming and debugging. 

I think Zend Studio is the best among the three that I have tested. It is not free, it costs about US$299 to buy a professional edition. However, I think it is worth the time and energy you will save! There is no free lunch in this world. 

Furether, from my several years experiences of using Linux, I have to say that freeware is not as good as commercial ones, although there are some very good freeware.