AMP Installation
Overview
- Prerequisites
- Allocate Database
- Bootstrapping a Project
- Serving the Web Application
Prerequisites
Allocate Database
- We will use the following key values for the section below
- Database Name:
wordpress_database
- Database User:
wordpress_username
- Database Pass:
wordpress_password
- Database Name:
- Execute the command below to connect to database
mysql -u root -p
- Once you have connected, it is advised for security reasons that you create a new user.
- The current user is the root user, which will always have all privledges and it is insecure to use it for general purposes.
- Execute the SQL commands below to create a new database.
DROP DATABASE wordpress_database;
CREATE DATABASE wordpress_database DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
- Execute the SQL commands below to create a new database user.
- Note if you forget the root password and the
wordpress_password
you will not have any way of resetting this.
- Note if you forget the root password and the
DROP USER wordpress_username@localhost;
FLUSH PRIVILEGES;
CREATE USER 'wordpress_username'@'localhost' IDENTIFIED BY 'wordpress_password';
GRANT ALL PRIVILEGES ON * . * TO 'wordpress_username'@'localhost';
Bootstrapping a Project
- Ensure wp-cli.phar is downloaded to your local project.
- Execute the command below to download a core WordPress project
php wp-cli.phar core download
- Modify the
wp-config.php
to ensure each of the following keys are assigned the values used when allocating database- Database Name:
wordpress_database
- Database User:
wordpress_username
- Database Pass:
wordpress_password
- Database Name:
Serving the Web Application
- Execute the command below to serve the newly downloaded project
php -S 127.0.0.1:8088
- Navigate to
http://localhost:8088
to create your first site and user.- If prompted to set a database name, database user, and database password, ensure your values match the aforementioned keys from allocating the database.