In the next couple of weeks, I’m planning on developing a Joomla 1.5 module so that I can flex my PHP muscles and get some more experience developing for Joomla. As part of this, It will be very helpful to have a local environment where I can test out the component that I’m plan on making. The process of setting up a Joomla testbed isn’t that terrible. It basically involves setting up a copy of Apache and MySQL on your local machine then installing Joomla on top of that. Most of the server-setup can be streamlined by using a copy of WAMP.
Here’s how to build a Joomla testing environment on Windows:
(1) Download a copy of WAMP
The first thing you’ll need to do is get a copy of WAMP. This stands for “Windows Apache MySQL and PHP”. It essentially provides a set of web-development framework that combines all of the tools that you need for creating a PHP test-bed in a Windows environment. Since Joomla is based on PHP, WAMP is a perfect solution to run Joomla on top of. You can download the installation files from WampServer.com
(2) Install WAMP
You should have a copy of “WampServer2.0h.exe” on your system. Double click the file to open it. Work your way through the installation by clicking next and I agree as many times as you need. It’s okay to leave the installation directory to “C:\WAMP” unless you have a specific desire to move it anywhere else. If you have the Windows Firewall running on your system, you’ll receive a notice that it’s trying to access the web. You’ll want to make sure it’s “unblocked” otherwise it’s likely that your WAMP install will not function properly.
You will also be asked about SMTP information. Unless you have a specific need to do anything that involves sending emails from your web-server, it’s safe to leave those blank. If you are developing contact forms or somethign that would require credentials, you can get those from your internet service provider.
(3) Take WAMP for a Test Drive
After installing WAMP, you have the option to start it up automatically. You can do this or launch WAMP from the start menu. You should be able to left-click on the WAMP icon in the system tray. You’ll get different options to turn WAMP on and off as well as access various database and web-server management tools. For now, we just want to click on LocalHost to make sure the web-server is running properly. If all is well, you’ll see a page that says “WAMPServer” that has a white-background.
(4) Download Joomla
To run a local copy of Joomla on our Windows/Joomla testbed, we’ll need to download the latest version from Joomla.org’s download page. You’ll want to download version 1.5 unles you have a specific reason to run Joomla 1.0. Be sure to get the “1.5.x Full Package” file.
(5) Extra Joomla to Your Website’s Root Directory
If you haven’t done anything special with your WAMP server, the root directory of your web-server should be located at “C:\wamp\www” on your system. First, delete the existing “index.php” file that’s sitting there then extract all of the Joomla files there.
(6) Setup a Database for Joomla to Run in
Left click your WAMP icon in the system tray then choose the phpMyAdmin option. This is a piece of software that lets you manage the database component of the WAMP stack. We need to setup a database for our local copy of Joomla to use. On the first screen you see, you’ll have the option of creating a database.
This is a screenshot of me creating a database called “JoomlaDB”
This is all you should need to do with phpMyAdmin for the setup process. Since it’s a local machine, we’ll just use the “root” login for our MySQL Server. If this was a production environment, you would want to create separate account to access your database.
(7) Run the Joomla Setup
After getting your files extracted, visit your local web-server by pointing your browser to http://localhost/ or by using the link in the WAMP tray-icon and going to your “LocalHost” option. At this point, you’ll be at the standard Joomla setup process. The first three steps are straight forward, the only “hard” part is setting up the database. When you hit step three, use “Localhost” for the database server “root” for the mysql user, and leave the password blank. For the name of your database, enter in the name of the database you created in the previous step. In my example, I used “JoomlaDB” as my database name. You won’t need a database password since we’re developing locally.
For step four of the installation, it’s okay to not enable the FTP layer since we are developing locally. On step five, you’ll need to pick out a name for your site, and create an administrative account. It’s probably a good idea to install the sample data package so that you have a base website to develop from.
If your install is successful, you should see a screen like this:
(8) Delete Joomla’s “Installation” Directory
After finishing the Joomla install, you’ll need to go back to your “C:\WAMP\WWWROOT\” directory (or wherever you have it located) and delete the folder called “Installation” before using Joomla.
(9) Pat Yourself on the Back
After deleting the installation directory, browse to http://localhost/ again and if your install was successful, you should see a screen like this:
You now have everything you need to do to begin playing around with Joomla on your local machine. You can browse to http://localhost/administrator/ and login with the credentials you made during setup to get into the back-end of Joomla.
(10) Get Developing!
Once you get your Windows Joomla testing environment setup, start developing some modules, components, mambots, and the like. Here are some resources to help you get started with Joomla Development
- The Official Joomla Developer Site
- A quick Joomla component development introduction (Trashfactor)
- Creating a Custom Joomla Module (JoomlaTutorials.com)