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:
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.
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.
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.
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_.
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.
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.