movie icon image

ExpressionEngine How-to Articles

Topics range from beginner to advanced, but are all born out of real world, professional, day-to-day use of ExpressionEngine.

Developing an ExpressionEngine Site Locally

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!

Additional Resources:

 

Posted on Nov 30, 2008 by Ryan Irelan

Filed Under: How-To, ExpressionEngine Development

Steve Stedman10:50 on 02.10.2009

Great article, Ryan. I just stumbled across this site and love what you’re doing here. Nice to see so much meaty ExpressionEngine stuff (or would that be meatEE?) in one place.

MAMP is definitely on a short list of killer Mac apps—it brings simplicity to local web development. Just install and run.

I also highly recommend VirtualHostX (http://clickontyler.com/virtualhostx/) for easily managing virtual hosts. Instead of using the localhost:8888 address for the local dev server, you could use eeinsider.dev (or eeinsider.local, etc.). And you can have multiple local hosts without restarting MAMP. This setup even makes IE testing in a virtual Windows environment easier: http://plebeosaur.us/web-development/pointing-to-mamp-from-virtual-windows/

Mike10:07 on 06.20.2009

This is great and all, but how do manage releases after your initial deployment?

How do you take the changes made to your local database, and deploy them to production, iteratively?

Thanks,
Mike

manuel huertas13:24 on 08.30.2009

Hi Ryan nice article, I have a small question though, I can’t get the “email” module to work when using localhost wamp server, I mean for example I am using freeform, and entries are working fine, but confirmation emails are not being sent to my email account, neither the confirmation emails from the “mailing list” module in the communicate tab, do you know if there is any setup or tweak to do to wamp server in order to get this to work? much thanks in advance.

Post a Comment




Please notify me of follow-up comments.


Search EE Insider
Private ExpressionEngine Training
EE Screencasts