InfoWorld review: Eight PHP power tools
Eclipse's coding assistance is excellent. Aside from the basics (such as syntax highlighting), Code Assist will watch as you type and conjure a pop-up to suggest possibilities for completing a partial code element. These features apply to HTML and JavaScript, as well as PHP. Note that for JavaScript Code Assist to work, you have to enable JavaScript for your project -- a separate step that I missed the first couple of times.
As with any multilanguage IDE, Eclipse PDT's documentation can be daunting, and it only gets worse as you add plug-ins. You can't blame that on the IDE, though. On the plus side, all the documentation is available in a single, searchable interface.
While Eclipse can support both the Xdebug and Zend debuggers, the two are not compatible -- only one can be enabled for a given instance of the PHP runtime. Therefore, unless you want to be repeatedly modifying project configurations, you should pick one debugger and stick with that. We chose the Zend debugger.
See the next PHP tool: MPSoftware's phpDesigner 7
MPSoftware's phpDesigner 7 MPSoftware's phpDesigner is only available for Windows. This limitation is understandable, given that it is the product of a one-man micro-ISV: Michael Pham, founder, owner, and engineering department for Denmark-based MPSoftware.
A fully functioning 21-day trial version is available for download from the MPSoftware Website. We tested an early release candidate of version 7 of the IDE, and it is an impressive bit of work for a one-person operation.
[ Is Perl, Python, or Ruby best? Do Java or JavaScript count? See "The best open source programming language." ]
Installation of phpDesigner is swift and easy, requiring no additional plug-ins or add-ons. Though phpDesigner is a PHP development tool, it can be used to edit source from a variety of languages, including Python, Ruby, Java, Perl, and others. The IDE offers only syntax highlighting in the additional languages. Active editing assistance (code completion) is available only for PHP, HTML/XHTML, CSS, and JavaScript.
As for phpDesigner, it's equipped with a wide range of code libraries, including the PHP Web-building framework Smarty and many popular SQL databases. The IDE also includes a built-in server equipped with Xdebug. Although phpDesigner can debug Web applications running on an external server (we used a XAMPP installation), it cannot at this time debug applications running on remote systems.
The right side of the IDE is a phalanx of code explorers. These include the Code Explorer, a hierarchical navigation window for the current PHP file, and Code Inspector, a kind of property editor for HTML code. Code Inspector displays -- and lets you modify -- attributes allowed for the HTML tag currently highlighted in the code editor. There's also File Browser, a standard browser into the local file system; FTP/SFTP, a graphical FTP/SFTP explorer; and Project, a standard Project navigation window. In addition, Templates and Snippets are two separate explorers that serve as repositories for prewritten source-code fragments and skeletons that you can drop into the source editor window to accelerate code production.
While working in phpDesigner's text editor, you can -- at any point -- request an "intelligent suggestion" by pressing the Ctrl-Space key combination. This opens a window of allowed source code clauses based on the context of the current insertion point. Code completion is also available. For example, enter an object instance, type the "->" access notation, and a window blooms open with all available methods and variables.
With phpDesigner's HTML preview feature, you can display a Web page in Firefox, Internet Explorer, Safari, or Opera (provided, of course, that the associated browser is installed) from within the IDE. Given that the same HTML might not display identically in different browsers, this is a particularly useful feature.
In addition, phpDesigner lets you check your PHP code's syntax before either running or debugging the application by clicking a "check syntax" button off the debugger menu. This checking is in addition to the as-you-type syntax checking that will catch simple errors in individual lines of code.
If you're debugging a PHP script (that is, a PHP program that runs from the command line), you can run the PHP interpreter directly from within the IDE. The only prerequisite is that you must show phpDesigner the path to the PHP configuration file. For debugging Web applications, phpDesigner plays well with XAMPP; in fact, the documentation recommends XAMPP as the easiest way to construct an Apache-PHP-MySQL development system.
See the next PHP tool: NetBeans
NetBeans IDE NetBeans is a free, multilanguage IDE available from NetBeans.org. Though NetBeans began life as a Java IDE, versions exist for Python, Ruby, JavaScript, Groovy, C/C++, and PHP. The NetBeans download site offers language-specific bundles, as well as a 300MB-plus kitchen-sink version that installs everything that NetBeans has to offer.
The IDE is Java-based, and it will run on Windows, Mac OS X, Linux, and Solaris. We installed the 6.7.1 version on Windows. NetBeans downloads as a self-installing executable, and the PHP installation includes code editors for PHP, HTML, CSS, and JavaScript. NetBeans PHP is also equipped with explorers for databases and Web services, as well as interfaces into a Hudson continuous integration server and the Bugzilla and JIRA issue trackers.
[ Nine Rails IDEs are leaving the station. Which one should you ride? See "Lab test: Climb aboard Ruby on Rails." ]
The NetBeans IDE interface is a collection of dockable windows, arranged in the familiar "explorers on the left, editors to the right" format. The explorers include a typical project navigator, a file system navigator, and a database explorer. To this trio, NetBeans adds a Web services explorer.
The Web services explorer is prepopulated with nodes corresponding to services from Amazon, Facebook, Google, and other popular sites. You can drill down into a particular service to examine its offered functions and their arguments. Even better: Drag a function from the Web service explorer onto a PHP file in the source editor window, and NetBeans will write the code necessary to call that Web service function.
NetBeans source editing has all the code completion fundamentals. It will close brackets and parentheses, and it provides context-sensitive proposals for PHP language elements: Type in an object and a pop-up appears, listing known instance variables and functions. If you've provided PHPDoc-formatted documentation for the class, that information will be displayed as well.
Because NetBeans PHP includes JavaScript editing capabilities, it will recognize when you have entered embedded JavaScript in the HTML portion of a PHP source file (via the "<script... >" tag) and provide context-aware code completion of JavaScript elements.
NetBeans supports debugging on both local and remote servers. To debug on a remote system, you must first establish FTP (or SFTP) settings for the project so that source files can be transferred to the debug target. NetBeans lets you configure your projects so that files are transferred when they are saved or when the source application is executed. Remote debugging also requires you to set up path mapping so that the debugger knows which local source file corresponds to a given URL on the remote system.
For PHP debugging, NetBeans uses Xdebug. The IDE can also debug client-side JavaScript using a NetBeans-supplied JavaScript debugger. (The NetBeans JavaScript debugger is based on Firebug, an add-on to the Firefox browser.) To debug JavaScript in a PHP file, simply start a debug session, select to debug PHP and JavaScript in the ensuing window, and a Firefox window is launched with the NetBeans JavaScript debugger installed and activated.
See the next PHP tool: NuSphere PhpED
NuSphere PhpED PhpED, available from NuSphere, runs only on Windows, though NuSphere claims that you can execute the IDE on Mac or Linux using the Wine emulator. We tested the most recent version, 5.9, on a Windows XP system. PhpED comes in standard and professional versions. As you might guess, the latter has more features than the former; the Web site includes a comparison table. Special discounts are available for students, but if you want to try out PhpED, you can download a free 21-day trial version.
The PhpED IDE is equipped with tools peripheral to -- but useful in -- PHP development. These include a DB Client for database management, a Terminals window for managing Telnet or SSH connections, and a NuSOAP window for working with Web services. PhpED also provides its own embedded Web server for executing and debugging applications directly in the IDE, but the documentation states that this is suitable for small applications only. Full-blown Web applications should be debugged on an external Web server; PhpED's debugger, DBG, can work with Apache, IIS, or any Web server that executes a standard PHP runtime.
[ Debugging a mixture of HTML, CSS, JavaScript, PHP, and SQL requires the right tools. See "Debugging PHP Web apps is hard to do." ]