DEV Community

KenjiDoom
KenjiDoom

Posted on

Installing PHP and MariaDB for OpenLiteSpeed. PT2

Next we shall install PHP and MariaDB for our OpenLiteSpeed web server, these two will be needed for our WordPress website. MariaDB is one of the most popular MySQL database servers in the world, it's also open source and everyone loves that. PHP is a general purpose scripting language that is heavily used for web development. These two will be needed for creating databases for WordPress and more.

Step 1: Installing MariaDB
Mariadb

sudo apt-get install mariadb-server mariadb-client
Enter fullscreen mode Exit fullscreen mode

And just like last time, we're also going to want to start the service, using systemctl.
Mariadb_status

sudo systemctl start mariadb.service
sudo systemctl status mariadb.service 
Enter fullscreen mode Exit fullscreen mode

Next step is to secure MariaDB

mysql_secure_installation
# Secure Installation
Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Enter fullscreen mode Exit fullscreen mode

Step 2. Installing PHP
Now if we head over to https://IP:7080/login.php, login using the credentials OpenLiteSpeed generated for us from the last post.Web Admin user/password is admin/NmQ0ODliopenlitespeed-login
Once logged into the dashboard. Head on over to Tools → Compile PHP, then select version 8.0.11.
Php-step1
php-step2
Now the last step, but before we start it, we need to open a new terminal and type the following command for it to run.
Termianl_command

sudo /usr/local/lsws/phpbuild/buildphp_manual_run.sh
Enter fullscreen mode Exit fullscreen mode

Then it should look something like this once it's finished.
step-3
step-4
To verify that PHP is up and running, type the following URL into the web browser. http://IP:8088/phpinfo.php
php-info
Voilà! Now PHP and MariaDB are both installed and will be used for WordPress later down the line.

Thanks for reading!
Kenji

Top comments (0)