Are you ready to take a step beyond writing code in a text editor like UltraEdit, BBEdit, or TextMate? Would you like to see those PHP and JavaScript syntax errors in the editor, without transferring files to the server or opening a browser? If so, then you're ready to jump into the world of the IDE — Integrated Development Environment. I'll compare the free, open source Eclipse IDE to a few of its commercial competitors Then we'll go through the steps to install Eclipse PDT All-In-One, the Zend Debugger, JSEclipse, and Subclipse.
Why an IDE? Let there be no mistake, I still love BBEdit and TextMate. I use both daily at work and at home for quick edits and I actually wrote this post in TextMate. But if you spend a good portion of your day writing PHP, an IDE will save you time in small increments by highlighting those unbalanced braces and missing semicolons, displaying PHP function arguments, and allowing you to debug your code right in the editor.
There are commercial IDEs available and I've use a few of them. I tried an early version of Eclipse with the xored studio but the combo wasn't feature-rich and didn't perform as well as Zend Studio. I later switched from Zend to Active State's Komodo. I've been happy Komodo but it's sluggish performance on my PPC Mac drove me back to giving Eclipse another try.
I started using Eclipse with PDT at work about a year and am amazed at how much PDT, formerly PHP IDE, has improved over the past four years. Eclipse is first a Java development environment, but extensions exist for a bunch of other languages, including Perl, Ruby, and Tcl. Okay, enough with the commentary, let's get to it, shall we?
Installation couldn't be easier. Visit the Eclipse PDT download page, select a stable build link, scroll down to the PDT All-in-One section, and select the download for your platform.
http://download.eclipse.org/tools/pdt/downloads/
Once the download is complete, unpack and move the 'eclipse' folder to your Applications or Program Files folder. Fire up Eclipse, create a new PHP file or project, and code away.
Out of the box, Eclipse provides PHP syntax highlighting, code completion, PHP documentation, phpDoc support, and more. Local and server debugging, however, require the installation of XDebug or Zend Debugger extension. Here's how to enable local debugging with the Zend Debugger.
You should now have a PHP Debug Perspective, complete with variable tracing, breakpoints, and CLI and browser debug output views.
To add improved JavaScript editing abilities to Eclipse, install JSEclipse from Adobe Labs. JSEclipse also provides editing support for popular JavaScript libraries, including YUI, Dojo, Prototype, and more. To install JSEclipse with the Update Manager
To create a new JS file, select New->File->Other->Web->JavaScript. You should now have code completion and error highlighting for JavaScript files.
To add support for Subversion revision management you'll need to install Subclipse from tigris.org, the developers of Subversion. To install, let's use the Update Manager again.
To checkout an existing Subversion repository
I've just started to use some of the data integration and design extensions available for Eclipse and will post a followup soon. In the meantime, happy coding!
Comments
Good article, this is my
Good article, this is my first time to try JEclipse.
So far i haven't found the useful of it, time will tell.
--
Daniel, programmer of insomnia herbal
Any hint about running under OpenSuse 11.0 ?
Hello to everybody. When download eclipse-pdt all-in-one and run ./eclipse, I unfortunately get the following :
JVM terminated. Exit code=13
/usr/bin/java
-Xms40m
-Xmx256m
-jar /home/fda/Desktop/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-os linux
-ws gtk
-arch x86
-showsplash
-launcher /home/fda/Desktop/eclipse/eclipse
-name Eclipse
--launcher.library /home/fda/Desktop/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.3.R33x_v20080118/eclipse_1023.so
-startup /home/fda/Desktop/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-exitdata a70007
-vm /usr/bin/java
-vmargs
-Xms40m
-Xmx256m
-jar /home/fda/Desktop/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
Could it be possibly related to the fact that I am running the x86-64 version of OpenSuse ?
My version of java seems to be the 1.6.0 :
$ java -version
java version "1.6.0"
IcedTea Runtime Environment (build 1.6.0-b09)
OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)
Any hint about what is going on ? :-/
I can't see php inside Eclipse
I have installed Eclipse PDT All-In-One on two different computers. On one of them I can see php in the perspectives and everything works fine, but on the other I can't see php anywhere. I have tried everything I could imagine but haven't figured out what the problem is.
It's just weird, but maybe someone has a hint?
Thanks,
Andrea
I have the same problem.
I have the same problem. After upgrading to JDK 1.6, the problem was solved.
Good Luck!
how to save the modifed file to remote system
I've eclipse with rse installed. Am able to navigate and view the files of the remote machine connected. Now after modifying a file it saves to my local machine. I don't know how to save the same file to the remote machine connected..? kindly help me out..
Where is the introduction?
So now I installed PDT and the features, but I was expecting a guide and introduction to most relevant tools and processes when working with this program...
Java 6 update 7
I still don't have PDT :(
no php in eclipse
Hi,
I've copied all files to the eclipse folder but in eclipse there is no mention about php.
Where download JSEclipse
There's no more JSEclipse on adobe .... where should i download it ?
Apparently the JSEclipse update site has changed
I updated the link in the instructions but haven't tested it. Not sure why it changed or if the link I found will continue to be available, if it works.
Please report back if to let folks know if it works or not. I'll try to investigate more when I have time.
Thanks for the links
Thank you very much, the link work ...
Debugger
I followed the install guide from above however when pressing F11 to run debugger, I receive a error stating: "Unable To Launch", "The selection cannot be launched, and there are no recent launches.".
Am I doing something wrong? I am use to UltraEdit with the PHP EXE. You just press a button and it debuggers and outputs any errors.
Thanks
Todd
PDT installs PHP?
Great article. I'm new to Eclipse and was wondering, does the PDT all-in-one package install PHP for you on your computer?
Yes, it does, but...
It installs PHP binaries for running and debugging purposes. These binaries are CLI-only, not the PHP module for Apache.
Take a look at the PHP 4 and 5 binaries in org.zend.php.debug.debugger.macosx_5.2.12.v20071210/resources/
thanks for the help. i'm now
thanks for the help. i'm now up and running with PHP.
hi
Thanks for this detailed articles on installing all these plugins. Being wanting answers for a long time now.Am so glad i stumbled on your website. Great work!!
Detailed step-by-step guide for setting up PDT+XDebug
Here's a detailed step-by-step article for setting up a PHP debugger using PDT+XDebug and XAMPP:
http://robsnotebook.com/php_debugger_pdt_xdebug
Thanks for sharing Rob.
Thanks for sharing Rob.
I couldn't get the debugger
I couldn't get the debugger going in 1.0.3. I did some reading and found a number of things have changed in this version but couldn't find sufficient documentation to follow on. I will try again later when hopefully all the changes are well documented. Thanks for the article.
Publishing to the server
Unless I've missed something, I can't find a way to publish my files to my Apache server.
Does Zend do this for you? Based on the Help in Eclipse, it does not. And for me, as a newbie to PHP, it's really helpful to have the files publish right from my project in Eclipse.
Is there any word on if this is coming? Right now I'm keeping my files in a static web project, so they'll automatically publish to my server when I save them. And then I'll just copy them back when I need to use the debugger.
I have the same question. I
I have the same question. I cant get my PDT configured to have the files published to the Apache Web server directly. How did you use static web project to do this? Can you elaborate? thanks
Two methods to publish, probably others
@PHPn00b and @btm, I'm aware of two methods to publish project files. I use Subversion to manage revisions and to checkout updates on my production server and am very happy with the flexibility and power using version control provides.
@ragaskar commented on the RSE Eclipse plugin which might open up the possibility of publishing files from the command line via scp or ftp.
There may be other file publishing plugins that provide what you're looking for.
Whenever I open a file in
Whenever I open a file in php, it always opens in other editor(dreamweaver 8.0). The same thing happens when moving between php file tabs already in the workbench. So I m forced to work in dreamweaver editor.
Kindly provide the solution.
Change File Association on Windows
Open My Computer, and on the menu bar choose Tools -> Folder Options and take a look at the File Types tab. Scroll down on the registered file types and find and edit the .php extensions. Hope this helps.
Change editor file associations
You can change the editor associated with files that have a .php file extension. I don't recall how to do it on Windows, but on the Mac, select a PHP file, select Get Info, change the Open With value, and click the 'Change All...' button.
Debugger
I installed the all in one package for Windows and I can set breakpoints etc and there seems to be some mention in the settings that its using the zend debugger however I cannot get it to stop on the breakpoint. Do i still need to install the Zend debugger? I have seen contrasting documentation to say the all in one does containt the debugger and documentation that it doesn't.
Tutorial Eclipse PDT using Zend Debugger
Hello,
I've also been struggling with getting the Zend Debugger to work inside eclipse PDT but finally it works! I made a tutorial of 7 page's describing the installation/use of the Zend Debugger on a local Wamp 1.7.4 PHP server.
You can download the tutorial together with a eclipse PHP project 'debugtester' from http://www.kinetiek.com/files/download/debugtester.zip.
regards, Mike
Thanks Mike
Really useful tutorial :)
Yes, I believe so
Despite what you've seen to the contrary, I'd go ahead and install the debugger. If that doesn't work, perhaps you could try Xdebug.
why jsEclipse and not Aptana?
Thats the question, why using jsEclipse and not the Aptana plug-in for Eclipse?, I think is much complete
Post new comment