Posts

How to install PHP 7.3 on Ubuntu 20.04

To install PHP 7.3 on Ubuntu 20.04, you’ll need to use a third-party repository since PHP 7.3 is not available in the default Ubuntu repositories. Here are the steps to install PHP 7.3:

  1. Update the package list and install software-properties-common:
sudo apt update
sudo apt install software-properties-common
  1. Add the Ondrej PHP repository, which provides different PHP versions:
sudo add-apt-repository ppa:ondrej/php
  1. Update the package list again after adding the repository:
sudo apt update
  1. Install PHP 7.3 and the necessary modules:
sudo apt install php7.3
sudo apt install php7.3-cli php7.3-fpm php7.3-mysql php7.3-curl php7.3-gd php7.3-mbstring php7.3-xml php7.3-zip
  1. Once the installation is complete, you can check the installed PHP version:
php -v
  1. If you have other PHP versions installed, you can switch between them using the update-alternatives command. For example, to switch to PHP 7.3:
sudo update-alternatives --set php /usr/bin/php7.3
sudo update-alternatives --set phar /usr/bin/phar7.3
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.3
  1. Restart the PHP-FPM service to apply changes (if you installed php7.3-fpm):
sudo systemctl restart php7.3-fpm

That’s it! You now have PHP 7.3 installed on your Ubuntu 20.04 system.

How to Install MariaDB on Ubuntu: A Step-by-Step Guide

Title: How to Install MariaDB on Ubuntu: A Comprehensive Guide for Professionals

Introduction: This comprehensive guide provides step-by-step instructions on installing MariaDB on a Vultr Ubuntu cloud server. Suitable for professionals, this guide is applicable to Ubuntu 16.04 through Ubuntu 20.10 LTS versions. MariaDB, a robust and feature-rich relational database management system, serves as a drop-in replacement for MySQL.

  1. Deploying Ubuntu Server Before proceeding with the installation, deploy a new instance of the Ubuntu Vultr cloud server. Follow the best practices guides listed below to ensure a secure and optimized setup:
  • Create a sudo user
  • Update the Ubuntu server
  • Switch to the sudo user for the remaining steps
  1. Installing MariaDB To install MariaDB and set it up as a replacement for MySQL, execute the following commands in the terminal:
$ sudo apt install mariadb-server mariadb-client -y

Enable MariaDB to start automatically during system boot with the following command:

$ sudo systemctl enable mariadb.service

To secure the MariaDB installation, run the MySQL Secure Installation script:

$ sudo mysql_secure_installation

During the script execution, respond to the security questions as follows:

  • For the initial root password, press ENTER as there is no password set.
  • When prompted, set a new password for the root account and confirm it.
  • Press ENTER to remove the anonymous user.
  • Disallow remote root logins by pressing ENTER.
  • Press ENTER to remove the test database.
  • Reload the privilege tables by pressing ENTER.
  1. Testing the Installation Ensure the installation was successful by connecting to the MariaDB server as the root user:
$ mysql -u root -p -h localhost

Within the MariaDB client, create a test user and a test database:

> CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'test_pass';
> CREATE DATABASE test_database;

Grant the test user all privileges on the test database:

> GRANT ALL PRIVILEGES ON test_database.* TO 'test_user'@'localhost';

Exit the MariaDB client:

> quit

Conclusion: Congratulations! You have successfully installed MariaDB on a Vultr Ubuntu cloud server. For further information and advanced usage, refer to the official MariaDB documentation.

For more details, visit: Link to official MariaDB documentation

How to Install MariaDB on Ubuntu?

Follow up above steps.