Feeds

NetBeans extension makes simple work of PHP

Preview in review

Secure remote control for conventional and virtual desktops

Arriving with the NetBeans 6.1 release last week was the NetBeans IDE Early Access for PHP. This provides a complete PHP integrated development environment hosted in NetBeans, re-using the infrastructure NetBeans has already employed for Java and Ruby.

Having walked through the main NetBeans IDE, I thought it worth looking inside the PHP update to see what it offers one of today's most popular languages.

Available as a separate download via the NetBeans site, the early access installs separately from any existing installation of the IDE, making it safe to play with without risking any productive development environment.

Installation is straightforward on the main supported platforms - Windows, Linux, Solaris and Mac OS X - but there are some entry level requirements to make it useful as a PHP environment. You'll need a working installation of PHP 5.x, a PHP debugger (XDebug is strongly recommended), a web server (Apache) and a database server (MySQL gets the most support out of the box).

If you already do some PHP development you'll have all of this in place, if not then you'll need to get it all up and running before you can do anything useful. For those who like things easy, the best bet is to download a single package to get the works, such as XAMPP for Windows or Linux.

Click and create

Once everything is in place, creating a PHP project is as simple as selecting File > New Project or clicking on the New Project button on the toolbar. The New Project dialog box gives you the chance to enter the directory for your source files (such as PHP, XHTML and CSS), the directory on the web server where you'll deploy these files, and the URL for the application. Along with these, you also get the option to create an index.php file as the entry point of your application.

As you'd expect from an IDE all of the editor functionality is in place with PHP syntax highlighting, code completion, integrated help, error flagging and so on.

The code completion is context sensitive, so entering $ inside the PHP directive gives you access to the run-time variables (such as $_SERVER). Anywhere else on the page, the $ symbol is just that. You also get drag and drop from a palette of HTML elements such as tables and forms. Code folding, formatting and ease of navigation - the kinds of features you'd expect from a PHP editor - are also present and correct.

There's more to building an application than cutting code, though. On the database and server side of things there are some nice NetBeans features. While NetBeans includes support for a number of different servers and databases, it's MySQL that gets pride of place - no big surprise given Sun Microsystems now owns MySQL. This makes it easy to hook up to a MySQL database server so that you can interact directly with the database for your PHP app.

You can also create a file with a .sql extension (though for some reason there's no menu option to create a SQL file) and use that to run queries that define and/or change your database. For those used to the Rails set-up/tear down way of working you can pretty much achieve the same using these text files to define your database during development. When you're debugging, meanwhile, you can even craft ad-hoc queries and look at the grids of data that you get back.

Other supported file types include CSS, XHTML, XML and JavaScript. Again you get the usual range of editor support functions such as color coding and so on. In the case of CSS support there is also a style builder with preview, making it straightforward to put together the styles for your application. The JavaScript side of things is also very well handled - support for dynamic languages and scripting in general is, after all, a key component of NetBeans.

One of the other benefits that comes for free is version control - with support for CVS, Subversion and now Mercurial version control systems.

Missing pieces

Having said all this, it pays to remember we're dealing with an early access release, so there are still some rough edges while some nice-to-have features are still missing. An example of the former is control of the browser, which could be better. Running your application fires up whatever browser you've defined as your default, but for those who want to test with different browsers from within their IDE a degree of choice would be nice. On the latter, for the moment, there's little in the way of refactoring support. This would be something to look for in a finished product.

Overall, though, this is another big step forward for NetBeans in the march towards being the IDE of choice for dynamic languages and scripting. While there is competition out there, solid support for Ruby, JavaScript and - now - PHP, combined with the fact improved support for Jython is on the horizon, means NetBeans is showing the most pace.®

The essential guide to IT transformation

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Munich considers dumping Linux for ... GULP ... Windows!
Give a penguinista a hug, the Outlook's not good for open source's poster child
Intel's Raspberry Pi rival Galileo can now run Windows
Behold the Internet of Things. Wintel Things
Linux Foundation says many Linux admins and engineers are certifiable
Floats exam program to help IT employers lock up talent
Microsoft cries UNINSTALL in the wake of Blue Screens of Death™
Cache crash causes contained choloric calamity
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 10 endpoint backup mistakes
Avoid the ten endpoint backup mistakes to ensure that your critical corporate data is protected and end user productivity is improved.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Rethinking backup and recovery in the modern data center
Combining intelligence, operational analytics, and automation to enable efficient, data-driven IT organizations using the HP ABR approach.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.