Why do I need a local developing environment?
With a local WordPress developing environment all plugins are stored on your local machine and accessed very easily. Also, it is much faster to develop locally then constantly saving changes to server files through an FTP account. So without further ado, to develop locally you need to create a localhost. A localhost is basically a server that runs on your machine locally. This is great for developing and testing plugins on a dummy test site before they go live. Once you have this localhost up and running, it will make your developing process quicker and more efficient.
So the very first thing you need to do to start developing it create your localhost. The software I highly recommend is MAMP. This is only for MAC OSX. Personally I have a mac so I use MAMP and thats what this tutorial will be based off of. Use WAMP for Microsoft which is about the same for setup and usage. Lets get right into how to install the software.
- Go to here and download the free version.
- Follow the installation process and then go to your Applications folder
- Notice there are two new folders: MAMP and MAMP PRO. If there is no MAMP PRO, skip to step 5.
- Delete MAMP PRO- you won’t need it now.
- Go to Applications->MAMP->MAMP.app. This is the main application, so every time you want to develop locally you need to start up the servers by clicking on the “Start Servers” button.
- Once everything is started, a web browser page should open and it will go to your MAMP admin backend. This is where you can edit your databases. Later you will have to create a new database for your dummy wordpress site to reference.
- To load some local files in your browser you need to go to Applications->MAMP->htdocs and create a new folder. I usually call mine “example”. This is where you can put your wordpress files after you download them which we cover in this Installing WordPress to a localhost with MAMP.
- Go to your web browser and type in localhost:8888. If this doesn’t work, then there is a problem with your ports. Open the MAMP.app and go to Prefrences. Under the Ports tab you should see Apache Port and MySQL Port. Hit the Reset MAMP Ports button. Here you should see the folder example. This is where all the wordpress files should go.
Once you have the localhost directory working you can then add all the wordpress files to it and start developing locally. There is another folder you should know about it is in Applications->MAMP->logs. Here you will find all your errors. If something doesn’t work or goes wrong, these files will let you know the error. I recommend for all wordpress related errors that you use the debug.log, which is explained in this Start Debuging Today!.
Take a look at the Installing WordPress to a localhost with MAMP for further details.
Please leave any comments below and email us at firstname.lastname@example.org or email@example.com for any further questions.