by Ryan Irelan
While building the site for the EE Screencasts “Building a Dynamic Website with ExpressionEngine” series, I didn’t use a remote server. Instead, I developed the site on my local computer. The reason I did it this way was because it’s an easier way to work; I can work offline and the pages load faster, which is helpful when I’m recording the EE training videos.
I know I’m not the only one who develops ExpressionEngine sites on the local computer first, but I’m also certain there are many people who do not and would like to learn more. If you’re one of those people, this ExpressionEngine tutorial is for you.
In order to run ExpressionEngine on your local computer you need to use the same software a remote server would use: Apache, MySQL and PHP. If you’re on a Mac this all comes with your computer, but it can be a challenge to set up and maintain. I recommend people use a sand-boxed environment so the setup is easy and operating system updates never break your development environment. It’s also much easier to get up and running on a different computer, if you find yourself away from your normal development machine.
And that’s where the following software applications come in to the picture:
- MAMP: MAMP (Mac Apache MySQL PHP) is easy to use, it’s self-contained and can be easily installed and a dev environment replicated on any other Mac. There is a free version and a paid version. The paid version offers extra functionality, like easily hosting more than one site at a time.
- WAMP: I’m not a Windows user, so I only have limited experience using WAMP (Windows Apache MySQL PHP), however from my basic testing it looks to be the Windows version of MAMP. All of the same reasons apply for using WAMP that I mentioned above for MAMP.
Both MAMP and WAMP are stand-alone applications and can be installed just as you would any other application. There are a few minor differences. With WAMP you have to put your EE files in the “www” directory, whereas with MAMP you just point it at any directory you want, no matter where it is on your computer.
After installing either application, the first thing you want to do is create the database for your EE site. On MAMP, the start page should launch automatically when you open the application. Click “phpMyAdmin” from the top navigation. Use the “Create New Database” field to create a new database. The username and password for MySQL in MAMP defaults to “root.” This will be needed when we install ExpressionEngine.
On WAMP, you can click the Tray icon (should look like a gauge or meter) and choose “phpMyAdmin.” This will open the browser to phpMyAdmin and you can create a database using the “Create New Database” field. WAMP uses the default MySQL username “root” and a blank password.
Once you have the application installed, database created, and you’ve pointed it to your EE project files, make sure all services are started. Launch your browser and go to
http://localhost on Windows and
http://localhost:8888 on the Mac. You should be able to install ExpressionEngine. If not, check that all of your settings are correct.
After you have EE up and running and you begin building out your site, don’t forget to save all templates as files. This allows you to open the entire EE project directory in your favorite text editor (I use TextMate on the Mac) and easily edit the files. Since they’re all local, you just save them as normal.
If you have any questions, please stop by the PragProg forums and speak up!