Feeds

NetBeans extension makes simple work of PHP

Preview in review

Security and trust: The backbone of doing business over the internet

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.®

Security and trust: The backbone of doing business over the internet

More from The Register

next story
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
Mozilla shutters Labs, tells nobody it's been dead for five months
Staffer's blog reveals all as projects languish on GitHub
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
Protecting users from Firesheep and other Sidejacking attacks with SSL
Discussing the vulnerabilities inherent in Wi-Fi networks, and how using TLS/SSL for your entire site will assure security.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.