WP Install

  1. First install Apache2:
    1. sudo apt-get install apache2 -y
  2. Next install PHP:
    1. sudo apt-get install php -y
  3. Next install PHP MYSQL support:
    1. sudo apt-get install php7.3-mysql
  4. Next install PHP GD (Graphics) support:
    1. sudo apt-get install php-gd
  5. Next restart apache2 to invoke PHP support:
    1. sudo service apache2 restart
  6. Now create a PHP test file:
    1. sudo nano /var/www/html/php_test.php
    2. Enter this in the file:
    3. <?php echo phpinfo(); ?>sudo service apache2 restart
    4. Enter CTRL-X, then Y then Enter
  7. Now test apache2, by entering into the browser address line:
    1. http://localhost/index.hmtl
    2. You should see this:
  8. Now test PHP by entering into the browser address line:
    1. http:/localhost/php_test.php
    2. You should see this:
  9. Check for MYSQL support
  10. Now install SQL database support:
    1. sudo apt-get install mariadb-server
  11. Now run SQL to setup the database for WordPress:
    1. sudo mysql
    2. Enter:
      1. create database wordpress;
      2. create user ‘name’@’localhost’ identified by ‘password’;
      3. grant all privileges on *.* to ‘name’@’localhost’;
      4. flush privileges;
      5. exit;
  12. Now invoke the SQL installation:
    1. Enter:
      1. sudo mysql_secure_installation
      2. Enter password used at ii) above
      3. Enter N
      4. Then Y, Y, Y, Y
  13. Now move to the installation directory:
    1. cd /var/www/html
    2. sudo wget https://wordpress.org.latest.tar.gz
    3. sudo tar xzf latest.tar.gz
    4. sudo mv wordpress/* .sudo service apache2 restart
    5. sudo mv index.html index.html_old
    6. sudo chown -R www-data: .
    7. Start the WordPress install:
      1. http://localhost
      2. sudo a2enmod rewrite
      3. cd /etc/apache2
      4. sudo nano apache2.conf
      5. Change entry None to All:
        1. <Directory /var/www/>
          Options Indexes FollowSymLinks
          AllowOverride All 
          Require all granted
      6. sudo service apache2 restart

  14. Optionally install ‘phpmyadmin’
    1. sudo apt-get install phpmyadmin
    2. If importing a WordPress site copy that was exported to a zip file:
      1. Delete any existing databases
      2. Restart Rpi
      3. Create a new database usually the name given at i) above e.g. wordpress
      4. Then import file e.g. wordpress.sql.zip noting there is a maximum file size for import of 2M
      5. To increase the import limit, edit PHP.ini ‘upload’ value to 8M
  15. The installation is complete.