Running LLMs Locally: A Quick Guide to LM Studio
6 March, 2024Installing and testing WordPress (or any other CMS) locally is actually slightly more complicated than installing it in a live server environment due to the lack of simple installation scripts. But the advantages can outweigh the disadvantages – not least the non-existent response times and the equally non-existent risks of affecting something else on the server.
MAMP is one of the more popular options for testing a local server on a Mac or PC. Let’s dive into what it is and how to get started with a local WordPress installation.
What is MAMP?
MAMP is short for Macintosh, Apache, MySQL and PHP. It was originally created for Mac and the abbreviation alludes to the far more common expression LAMP (where “L” means Linux). Nowadays, MAMP is also available in a Windows version. The free version of MAMP is limited to a single local server but is otherwise fully functional, with everything you need to run WordPress locally.
Step by step: MAMP + WordPress
1. Install MAMP
Download the application from the official website and run the installer (.pkg or .exe). The installation process is similar for Mac and Windows, but in the latter version you can choose not to install MAMP Pro and the Bonjour service used by the Pro version to preview content on Apple devices.
2. MAMP settings
Unless you have specific requirements, you don’t need to touch the default settings. But do take note of where the files should be placed. In Windows, the default folder is C:\MAMP\htdocs and the equivalent for Mac is Applications > MAMP > htdocs. Click “Open WebStart page” to open the web interface.
3. Create a MySQL Database for WordPress
Before you can install WordPress, you need to create a database. Start your MAMP server and go to phpMyAdmin via the web interface or directly at http://localhost/phpMyAdmin (Windows) or http://localhost:8888/phpMyAdmin5/ (Mac). In both cases, the default username and password are both “root”.
Click “New” in the left sidebar and give your database a name, such as “wp_lokal”, then click “Create” to finish.
Remember the database name, username, and password – you will need these when setting up WordPress.
4. Install WordPress locally
Now it’s time to install WordPress on your local MAMP server.
First, download the latest version of WordPress and extract the WordPress zip file into the htdocs folder. Make sure to overwrite the existing index.php file.
Open your browser and head over to http://localhost (Windows) or http://localhost:8888 (Mac) to run the WordPress installer.
Enter the database information:
- Database name: The database name from the previous step
- Username: root
- Password: root
- Database host: localhost
- Table prefix: wp_ (or whatever)
The last step before completing the installation is to enter the website name, username, and password. Finish by clicking “Install WordPress”.
Congratulations! You now have a fully functional local WordPress installation. Log in to the admin panel with the username and password from the previous step. Now you are free to install themes and plugins, and create posts and pages just like on any WordPress website.
Troubleshooting common issues
Here are some common issues and solutions:
- Cannot connect to the database
- Check that all parts of the MAMP server are running
- Verify that the database information in wp-config.php is correct
- White Screen of Death (WSOD):
- Enable WP_DEBUG in wp-config.php to see error messages
- Check for plugin or theme conflicts
- Installera WordPress lokalt med MAMP (Mac/Windows)Cannot upload files:
- Check the read and write permissions in your htdocs folder
Migrating from local to live environment
When or if you want to bring your locally developed WordPress installation online, you need to do the following:
- Export your local database from phpMyAdmin.
- Copy all WordPress files from your local installation to the live server.
- Create a new database on your live server and import your local export.
- Update wp-config.php with new database details.
- Update your permalinks in the WordPress settings.