WordPress Setup Using Raspberry Pi 3 And PHP

Introduction

 
This article demonstrates how to make a WordPress Setup Using Raspberry Pi 3 and PHP.
 
WordPress
 
Pi can handle a web server; so if you want to launch your own WordPress blogs with a proper back-end, you can easily do it. This web server is used to get a small amount of traffic and for development purposes.
 
Requirement
 
I used the following equipment for this Raspberry Pi web server article.
  • Raspberry Pi 3
  • Minimum 8GB SD Cord if you're using Raspberry Pi 3
  • Ethernet or Wifi
  • Putty
  • VNC Viewer
Optional
  • USB Keyboard
  • USB Mouse
Installation
 
In this article, I have made use of the standard operating system for the Raspberry Pi, known as Raspbian. If you haven't got this installed, then you can follow my previews article "Traffic Light System Using Raspberry Pi 3 and Raspbian Installation Process and LightWeight Web Server" link. First, you need to go and read my previous articles and then follow my instruction.
 
First, we will need to install an Apache2 web server. Just use the following commands.
  1. sudo apt-get install apache2 -y   
If you don't know the IP address, you can enter the following command line.
  1. hostname -I    
Open Browser, Enter IP address in the browser, and you should get an Apache instruction page.
 
WordPress
 
Next, we need to install MYSQL - SERVER PHP 7.0. Just use the following commands.
 
WordPress
  1. sudo apt-get install MySQL-server php7.0-mysql -y    
  2. sudo mysql_secure_installation   
Next, go to Configure MySQL server and now configure the password.
 
WordPress
  • We will need to download and extract the WordPress package.
     
    WordPress
     
    1. cd /var/www/html    
    2. sudo chown pi: .    
    3. rm *    
    4. wget http://wordpress.org/latest.tar.gz    
    5. tar xzf latest.tar.gz    
    6. mv wordpress/* ./    
    7. rm -rf wordpress latest.tar.gz    
    8. rm -rf index.html    
    9. sudo chown -R -f www-data:www-data /var/www/html   
  • Restart Apache otherwise you will get an error that PHP is missing the MYSQL module.
      1. sudo service apache2 restart 
  • Now that that's installed we will need to set up a database to connect, use the -u for the username, and  -p flag for the password. Leave no space b/w the flag and required text.
     
    WordPress
     
      1. sudo mysql -uroot -password   
  •  Now create the new DB for this WordPress.
      1. create database wordpress; 
You should now see the success statement. "Query OK, 1 row affected (0.00)"
 
image7
 
Now let's exit the MySQL prompt by pressing Ctrl + D.
 
Now, in a browser go to the IP address, and you should be presented with a WordPress setup screen.
  • Database Name   : wordpress
  • User Name           :   wpdb
  • Password             :   (Your Password)
  • Database Host     :   localhost
  • Table Prefix          :   wp_
     
    WordPress
     
    WordPress
     
    WordPress
Next, go to the PHP editor page and then change the code.
 
WordPress
 
Welcome Screen for WordPress
 
Welcome to the famous five-minute WordPress installation process. Just fill in the information.
 
WordPress
 
Just enter your username and password 
 
WordPress
 
Pi server might not work too well due to the limited resources available to Pi.
 
WordPress
 
Finally, we have successfully created a WordPress Set using Pi and PHP.