This is Part 4 of The Beginner’s Guide To Setting Up a Development Environment.
Although this series is geared towards setting up a development environment, it’s not exactly explicit as to what kind of environment.
After all, the kind of programming you do dictates what kind of environment you’ll setup. Some run mobile device environments, others run game development, some run device drive environments, and so on.
This particular series has been focused specifically on web development and so we’re going to focus on what goes into a local web development environment and how to configure it so we’ve got a solid setup for both web site and web application development.
1. Recalling The Stack
Earlier in the series, we talked about all of the different parts of the development stack and the role that each part plays when it comes to serving up a web-based project.
- Web servers serve files to the incoming request
- Databases act as storage mechanisms for information
- Programming Languages give us the ability to communicate with the database and return specific data to the requester via the web server.
In order to setup a development environment, we need those three components. Specifically, we’re going to install Apache, MySQL, and PHP.
2. Performing The Installation
Although it’s possible to install each of these independently of one another, there’s also a significant amount of configuration that’s needed in order to get everything setup. Instead, we’ll be using an all-in-one installer.
Specifically, we’ll use XAMPP since packages are available for Linux, Windows, and OS X; however, if you’d rather install something such as LAMP, MAMP, or WAMP, feel free but the screenshots and steps for configuration in this series are based on XAMPP.
First, download the package that’s appropriate fo ryour operating system.
To be clear, there are a few variations of the installer, pick the simplest one. This is not the light version and it doesn’t not include add-ons.
Next, we need to install it.
- A note for those of you on Windows: The installer may suggest installing the stack in C:Program Filesxampp. Though you can do this, I highly recommend installing it in C:xampp or another directory without spaces. In future development work – specifically that which will take you to the command line – spaces can cause headaches.
The installation will take a few minutes. That’s normal.
Once installation is completed, you will be presented with a command line displaying asking a few questions. First, you’ll be asked about creating Start Menu and Desktop shortcuts.
This is purely up to you, but I highly suggest it especially if you plan to be doing a lot of work as this will make it easier to access the XAMPP dashboard.
After that and depending on where you installed it, the installer may notice that the path in which it is running is not the same as the default path for Apache and will ask if you would like to update it.
If you’re prompted for this, say yes:
Next, you’ll be asked if XAMPP should be setup in such a way that it can run on a portable USB key. Although this is convenient, say no.
We’ll cover an alternative solution to this later in the series.
Next, the installer will proceed with more automated configuration and will then state that it’s ready to use. Except it’s not completely ready. Fun, right? You still need to set your time options.
Odds are the installer guessed your time zone correctly, so proceed with what it has provided.
Finally, you’re ready to actually start your server. The installer will provide you with a menu via the command line, but if you opted to install the desktop shortcuts, then you should see the new XAMPP icon on your desktop.
Either way you choose to launch it, you should see something similar to this:
The two primary applications we’re concerned with are Apache and MySQL. Go ahead and Start Apache.
Your operating system’s firewall may display a message asking if you wish to allow this application access. Say yes.
Next, launch your browser and navigate to http://localhost. If all has gone well, you should be presented with the XAMPP splash screen:
Feel free to explore what’s presented within the site itself, but we’ll be doing some custom configuration in the next post in the series.
3. Now What?
At this point, you should have a fully functional web development environment setup on your machine. Later in the series, we’re going to customize the installation even more. We will…
- Forgo the need for the portable installation of XAMPP and take advantage of Dropbox for hosting our projects
- Install a secondary database frontend that, in my opinion, is cleaner and easier to use than PHPMyAdmin
- Explore this particular setup and configuration for future projects
Cool stuff, right? Hopefully this will make local development a lot easier in your future work.
Daniel Merchen says
Great post, XAMPP is awesome for development applications. I’ve been running it for sometime as a local development tool. I look forward to your database frontend alternative. Would be interesting to see some basic tutorials on configuring a stack in the cloud on companies like RackSpace, SliceHost, VPS.net.
Tom McFarlin says
Noted – we’ll see what we can do!
May be some pricey tutorials ;).