How to install WordPress on Ubuntu ARM server with PHP 8

2022-09-13 By Nathan 6885 Views linux wordpress php8
8 reviews

WordPress is a robust CMS tool for things like creating and managing websites, blogging and building open-source websites that rely on PHP and MySQL programming languages. With its high-end flexibility and with more than 20,000 plugins actively running, it has certainly become the most preferred choice for developers and consumers.


wordpressphoto


This guide outlines the basic steps to install WordPress on the ARM server (Ubuntu 20) with PHP8.


First of all, make sure the server is updated. Use the following command to update the server.

# apt update && apt upgrade -y

armwordpress1

Installing Apache Webserver


  1. Start to install Apache Webserver.

    # apt install apache2 -y
    

    armwordpress2

  2. Check the status of Apache Webserver.

    # systemctl status apache2.service
    

    armwordpress3


Installing Database Server


  1. Start to install the MySQL database application.

    # apt install mysql-server -y
    

    armwordpress4

  2. Check the status of the MySQL database.

    # systemctl status mysql.service
    

    armwordpress5


Installing PHP 8


  1. Install the ca-certificates apt-transport-https software-properties-common using the following command.

    # apt install  ca-certificates apt-transport-https software-properties-common
    

    armwordpress6

  2. Add ppa:ondrej/php repository for additional versions of PHP.

    # add-apt-repository ppa:ondrej/php
    

    armwordpress7

  3. Install the following modules.

    # apt install php8.0 libapache2-mod-php8.0 -y
    
    # apt install php8.0-fpm libapache2-mod-fcgid -y
    
    # apt install php8.0-mysql
    

    armwordpress8

    armwordpress9

    armwordpress10

  4. Enable the following modules.

    # a2enmod proxy_fcgi setenvif
    
    # a2enconf php8.0-fpm
    

    armwordpress11

  5. Restart apache after enabling the modules.

    # systemctl restart apache2
    

    armwordpress12

  6. Verify the PHP version.

    # php -v
    

    armwordpress13

  7. Add a file info.php in /var/www/html/ and add the following into the file.

    # vim info.php
    

    armwordpress14


    <!--?php
    
    
    phpinfo();
    
    
    phpinfo(INFO_MODULES);
    
    
    ?-->
    

    armwordpress15

  8. Open your web browser and enter your domain name or server address as shown. Here is just the sample IP & domain.

    http://111.11.11.111/info.php
    
    OR
    
    http://your-domain.com/info.php
    

    armwordpress16

  9. Verify the PHP status.

    # systemctl status php8.0-fpm
    

    armwordpress17


Installing WordPress


  1. Change the directory to /var/www/html/.

    # cd /var/www/html/
    

    armwordpress18

  2. Remove/delete all the files in the /var/www/html/.

    # rm -rf /var/www/html/*
    

    armwordpress19

  3. Download the latest version of WordPress.

    # wget https://wordpress.org/latest.zip
    

    armwordpress20

  4. Extract the latest.zip using unzip command.

    # unzip latest.zip
    

    armwordpress21

  5. Move all the files inside /var/www/html/wordpress/ to /var/www/html/.

    # mv /var/www/html/wordpress/* /var/www/html/
    

    armwordpress22


Configuring a database for Wordpress in MySQL Database


  1. Log in to MySQL database.

    # mysql -u root -p
    

    armwordpress23

  2. At the MySQL shell, type the following commands. Remember to use your own, valid values for the database name, and database user, and also use a secure and robust password as the database user password:

    > CREATE DATABASE wordpress_database;
    
    > CREATE USER 'wpdb_user'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
    
    > GRANT ALL ON wordpress_database.* TO 'wpdb_user'@'%';
    
    > FLUSH PRIVILEGES;
    
    > EXIT;
    

    armwordpress24

  3. Copy the wp-config-sample.php and rename it to wp-config-sample.php.

    # cp wp-config-sample.php wp-config.php
    

    armwordpress25

  4. Edit wp-config.php file to add the database information.

    # vim wp-config.php
    

    armwordpress26


    Use the added database credentials:

    armwordpress27

  5. Add a user webuser (any name will suffice).

    # useradd webuser
    

    armwordpress28

  6. Change the ownership of the /var/www/html directory.

    # chown -R webuser:webuser /var/www/html
    

    armwordpress29

  7. Restart Apache and MySQL database.

    # systemctl restart apache2.service
    
    # systemctl restart mysql.service
    

    armwordpress30

  8. Open your web browser, then enter your domain name or server address and can see the WordPress website.

    http://123.123.123.123/
    
    OR
    
    http://your-domain.com/
    


Related LayerStack Product


Related Tutorials

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.