Feeds

NetBeans extension makes simple work of PHP

Preview in review

Beginner's guide to SSL certificates

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

Choosing a cloud hosting partner with confidence

More from The Register

next story
That dreaded syncing feeling: Will Microsoft EVER fix OneDrive?
Microsoft's long history of broken Windows sync
Mozilla, EFF, Cisco back free-as-in-FREE-BEER SSL cert authority
Let’s Encrypt to give HTTPS-everywhere a boost in 2015
SLURP! Flick your TONGUE around our LOLLIPOP – Google
Android 5 is coming – IF you're lucky enough to have the right gadget
Nokia's N1 fondleslab's HIDDEN BRILLIANCE: The 'Z Launcher'
Sugarcoating Android's Lollipop makes tab easier to swallow
Bug fixes! Get your APPLE BUG FIXES! iOS and OS X updates right here!
Yosemite fixes Wi-Fi hiccup, older iOS devices get performance boost
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
Facebook, working on Facebook at Work, works on Facebook. At Work
You don't want your cat or drunk pics at the office
Soz, web devs: Google snatches its Wallet off the table
Killing off web service in 3 months... but app-happy bonkers are fine
Meet Windows 10's new UI for OneDrive – also known as File Explorer
New preview build continues Redmond's retreat to the desktop
prev story

Whitepapers

Choosing cloud Backup services
Demystify how you can address your data protection needs in your small- to medium-sized business and select the best online backup service to meet your needs.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
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.
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
New hybrid storage solutions
Tackling data challenges through emerging hybrid storage solutions that enable optimum database performance whilst managing costs and increasingly large data stores.