Develop PHP Web Applications with NetBeans, VirtualBox and Turnkey LAMP Appliance

by Alfonso V. Romero | August 2009 | Open Source PHP Web Development

In this article by Alfonso Romero, we will learn how to configure NetBeans, VirtualBox and the Turnkey LAMP Appliance to develop complex PHP applications in a virtual environment. This article explains the process of creating a virtual machine, configuring the NetBeans PHP IDE, and managing a WordPress project with NetBeans in a step wise manner.

A couple of days ago, a client asked me for an easy way to develop PHP applications. Naturally, I told him the best way would be to pay me for doing it! Just kidding…

"Use the NetBeans IDE", I said to him, almost automatically. "But… isn’t NetBeans something related to Java?" he answered back, with a startled grin on his face.

"My dear friend, you can use NetBeans to develop software on Java, PHP, C++, and almost any other programming language I’ve heard of! You could even use it to work on a WordPress live Web site!" I said to him triumphantly. And that’s when a small light bulb lit up inside my mind... I introduced him to VirtualBox and the world of virtual machines, the Turnkey Linux LAMP appliance, and how to make all these software applications collaborate between each other. And that’s how this article was born.

So now, my dear readers, let’s get on with the action! Oh, and feel free to skip any section you don’t need, ok?

Download and Install VirtualBox

Go to the VirtualBox Web site and download the most recent version: http://download.virtualbox.org/virtualbox/3.0.4/VirtualBox-3.0.4-50677-Win.exe

After downloading VirtualBox, install it with all the default options (remember to register with Sun!).

Download the Turnkey LAMP appliance

Go to the Turnkey Linux Web site and download the LAMP appliance: http://www.turnkeylinux.org/download?file=turnkey-lamp-2009.02-hardy-x86.iso .

Download the NetBeans PHP IDE

Go to the Sun Web site and download the NetBeans PHP IDE here. After downloading NetBeans, install it with the default options.

Create a virtual machine

Open VirtualBox and click on the New button to create a virtual machine (VM). In the following screenshot I used the VirtualPHPDev name for my VM, but you can use whatever you want; just don’t use strange characters or signs:

PHP Team Development

Choose Linux and Ubuntu as the Operating System and Version, respectively. Click on Next to continue. Leave the default values for RAM and hard disk. When finished, click on the VirtualBox Settings button to open your virtual machine’s settings dialog, select the CD/DVD-ROM category, enable the Mount CD/DVD drive option, select the ISO Image File button and then click on the Invoke Virtual Media Manager button PHP Team Development.

PHP Team Development

Click on the Add button in the Virtual Media Manager to open up the Select a CD/DVD-ROM disk image file, go to the directory where you downloaded the Turnkey LAMP appliance and double-click on it to add it to the Virtual Media Manager:

PHP Team Development

Click on Select to close the Virtual Media Manager, and then click on OK to exit the Settings dialog. Now you can click on the Start button to start your LAMP virtual machine:

PHP Team Development

Select the Install to hard disk option in the Turnkey Linux menu screen and press Enter to start installing the LAMP appliance on your virtual machine. Eventually the following screen will show up:

PHP Team Development

Select the Guided option and press Enter to continue. The installer will ask if you want to save changes to disk. Select Yes and press Enter. The installer will start the disk formatting process and then you’ll get to the root password screen. Type the password twice for the root user, and then do the same for the MySQL user. The installer will continue and, after a while, the following installation completion screen will show up:

PHP Team Development

Select No, press Enter and then close the virtual machine typing shutdown -r now at the system prompt. You’ll return to the VirtualBox main screen. With your LAMP virtual machine selected, click on the Settings button to open the settings dialog box. Select the CD/DVD-ROM category and disable the Mount CD/DVD drive option. Then select the Network category, change the Attached to: option to Bridged Adapter and click on OK to continue:

PHP Team Development

You can start your LAMP virtual machine now. When ready, the following screen will appear:

PHP Team Development

The Bridged Adapter mode lets your virtual machine act as if it were another PC on the LAN, and consequently, it will have a different IP address. Write down the IP address shown in the Turnkey Linux Configuration Console screen, because you’ll need it to configure the NetBeans IDE later. You can minimize the LAMP virtual machine window now.

Sign up for a Packt account to see the rest of this article

Now that you've read a few articles, you might want to consider signing up for a Packt account. It takes a matter of seconds, will give you access to all the articles on PacktPub.com, and once you've signed up you'll be returned here to carry on reading your article.

Furthermore, you'll gain access to nine free ebooks, and be offered a free trial of PacktLib, Packt's online library. Simply enter your details here, or log in to your existing account.

Log in

...or register

Great tutorial by
First rate information in this article, many thanks.
Great tutorial by
I also recommend to look at Codelobster PHP Edition
Best tutorial ever. Period. by
If you follow it and do not try to be smarter than it, you will get the thing running WITHOUT A hitch. Thank you. Lanny
Great information by
Thanx for sharing with us this informatio,and thanx to sun for making our life easyer.
this is wonderful tutorial by
this is wonderful tutorial .. i read it 3 times and get a fantastic results and sure i put a copy of this lesson on my site here http://www.iksai.org

Post new comment

Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Sort A-Z