How to get set up with WordPress

Introduction

WordPress uses PHP, a server-side language, to render pages; therefore, we need to run WordPress on a server. When developing, it’s best to install WordPress on your local machine so that you can make changes in case something breaks. When you’re finished developing, you can upload your WordPress site to your web host.

Steps

1. Local server

Download an application to run a local server on your computer.

There are a few to choose from, but Xampp, Wamp or Mamp are commonly used. Xampp can run on Windows, Mac or Linux. Wamp runs on Windows and Mamp runs on Mac.

In our example, we’re going to be running Xampp which you can download here. Once downloaded and installed, you should be able to open an application that looks like this:

Local server

Note: Mac users may prefer to choose MAMP from the beginning as it’s well suited for Mac.

Click ‘Start’ for both Apache and MySQL, and test that your server is running by going to http://localhost/ in your browser which should load up a page saying ‘Welcome to Xampp’.

2. Download WordPress files

Next, you need to download the WordPress files from here. Take the zip file you’ve downloaded and copy it.

Navigate in your file explorer to where you have installed Xampp. On a Windows PC, it will likely be C:\xampp. For Mac go to the Volumes tab, click Mount and then Explore.

Xampp

Now click into the htdocs folder and create a new folder called ‘flower-power’. Inside this folder, paste your zip file with all your WordPress files and extract the zip file.

Zip file

3. Create a database for WordPress

It’s essential to understand the relationship WordPress has with its database. All the posts, pages, and comments made on WordPress’s admin side are stored in this database. To create a MySQL database, go to http://localhost/phpmyadmin/ and click Databases.

Create database

Enter a database name called ‘flower-power’ and click create.

4. Run the WordPress install

Go to localhost/flower-power, which will begin the installation wizard. Firstly, you’ll be asked for a preferred language for the installation and an overview of the required information where you can click ‘Let’s go’.

Enter ‘flower-power’ as the database name. Set the username to “root”, leave the password blank and leave database host as localhost and table prefix as wp_.

Wordpress install

It’s important to note that this only works for installation on your local computer. When you upload the website to your web host, you’ll need to create a user and assign a password with access to the database.

Next click ‘Run the installation’. Now set the Site Title to ‘Flower Power’, create your username and password which you must store. Add your email address and discourage search engines from indexing the site.

Finally, click ‘Login’ and input your username and password you just created. You should now be logged into your WordPress admin site.

Wordpress install

Activity

In this lesson, we covered installing and running a WordPress site locally using Xampp. If you would like to follow an installation video for Local by Flywheel (for Windows or Mac) or MAMP (for Mac), you can watch the following videos.

WATCH

Video: Local by Flywheel (38m)

Video: MAMP (1h 15m)


Lesson Task

Brief

To run PHP files, we need a server to run them on. When developing the site, we can use our localhost to host the files, but we need to upload them to a web host to make them live.

If you already have a web host, you can create a folder on your domain and upload files there. If you don’t have a domain, continue with the task.

level 1 proccess

  • Choose a web host. You can choose any web host you like, just make sure the package runs PHP and gives you at least one database. Generally, the entry-level packages should cover that. (If you’re unsure, the Beginner package on one.com will be fine.)

  • Next, you will choose a name for your domain. You can choose whatever you like.

  • Follow their setup wizard, and once complete, you can connect to the web host using FTP. FileZilla is a popular application for connecting to a web host using FTP.

  • Once you have connected to the web host using FTP, upload a file to your web host and test that it’s coming through correctly. Your web host likely has a folder called ‘public_html’ or ‘www’. This is where you’ll place the files and folders that should be displayed on your web host. We advise you to place assignments into their own folder instead of the website’s root for our programme.

Once you’ve completed installing an application to run a local server on your computer and installed WordPress, take some time to explore the admin panel and get familiar with how WordPress works.

You can create a post on your WordPress admin panel, then open up phpMyAdmin and go to the flower-power database and click to see wp_posts where you should find your post tracked in the database. It’s worth seeing how using the WordPress admin site updates the database, which is then used to build the website’s front-end.