You may use the same template, js, and css files/folders in every site you develop. You can optionally add the contents of a templates folder. Most content management systems require a database, and you can conveniently add one here.Ĭopy the contents of a template folder to the document root You can optionally create a MySQL database. MAMP PRO will automatically add an “index.php” file and a MAMP image to this location when your web server is restarted if the folder is empty. The document root is also known as the web root folder. The location of the documents (HTML/PHP files etc.) of a virtual host is called a document root. Names are not case-sensitive (upper and lower-case letters are not distinguished.) The host name may only contain letters and/or numbers, as well as dashes (“-“) but it may not begin or end with a “-“ character. The server name and port number in combination must be unique within MAMP PRO. To create a new host press the “Plus” button at the bottom left of the hosts table. The unreversed name may conflict with an outside domain name. The name of a host (server name) must be unique, often it’s practical to use a reverse domain naming scheme to easily identify them (e.g. Every host can have it’s own directory to store html, PHP files, and images. You can add an unlimited number of hosts allowing you to create one host per project. The virtual host “localhost” is created by default and cannot be deleted. You’ll need the WP-CLI to get it all working in tip top shape and Tom McFarlin has a great guide on Installing WP-CLI with MAMP | Tom McFarlin.MAMP PRO uses virtual hosts to allow your web servers to serve different websites. Matt Shaw over at Delicious Brains has a great guide for Automating Local WordPress Site Setup with Scripts. If only we could, I don’t know, automate it. Neat!īoy that was a lot of manual steps though wasn’t it. Follow the prompts on screen and in seconds you’ll have a fully functioning local development environment. If everything worked properly you’ll get a WordPress screen allowing your to set your language of choice. Now that you have WordPress running on a snazzy local development environment and you entered your database credentials, you can navigate to the domain you set up earlier in the browser of your choice. Make the something truly unique and generate a random string of characters for the password. NOTE: Never launch a site to a live environment with the database user and database password as root. Creatively enough this is “root” and “root” out of the box. Next you’ll need to update define('DB_USER', 'username_here') and define('DB_PASSWORD', 'password_here') with your MAMP Pro database user and password. Inside you’ll need to update the define('DB_NAME', 'database_name_here’) line to replace database_name_here with whatever you named your database during the MAMP Pro setup. The first step we’ll want to do is go into our WordPress directory and duplicate wp-config-sample.php and rename it to wp-config.php. Set your hostname, document root, and create a database all from MAMP. Then click Create and start your MAMP Pro servers. Alternatively you could create the database yourself from using phpMyAdmin. Then select to have MAMP create a database for you and name that database. This will be the folder containing your wp-config.php file. Click the folder icon next to Document root and set the root of your WordPress install. If you haven’t already drop a fresh version of WordPress in your preferred directory 1. Next you’ll want to set the path to the files for your site. Then enter the name for your sweet new development environment. Getting a host setup for WordPress development on MAMP Pro is another quick process.įirst, click the “+” under your list of hosts. To setup MAMP Pro all you need to do is head over to the website, download it, and install. There is one distinct difference between MAMP Pro and Docker / Vagrant. So it’s probably time to cover that as a local WordPress development option. That’s why I’ve found myself defaulting back to MAMP Pro for a lot of my development work. But boy does it get slow to start once you have a lot of sites through VVV. And both are excellent options with their own advantages.ĭocker is a relatively new tool in my box but I see it being useful for spinning up quick sites at While Vagrant is a great tool for sharing dev environments among our team at Red8 Interactive and using custom domains like. I’ve written about setting up local WordPress development environments using Vagrant and Docker.
0 Comments
Leave a Reply. |