×


Category: Linux Backup


Install PHP on Ubuntu 20.04 - Running Apache Web Server

This article covers the PHP installation on Ubuntu 20.04 system.  Basically, popular Content Management platforms such as WordPress, Drupal, and Magento are based on PHP.


To Install PHP on Ubuntu 20.04:

1. Update your server.

$ apt-get update && apt-get upgrade

2. Install PHP on Ubuntu 20.04, just run the following command.

$ apt-get install php

3. To verify if PHP is installed, run the following command.

php -v


To Install PHP 7.4 modules (extensions):

Run the command below.

apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php

To check all the PHP modules available in Ubuntu, run:

$ apt-cache search --names-only ^php


How to install PHP 8.0 on Ubuntu 20.04 or 18.04 ?

1. First, update your Ubuntu server:

$ apt-get update && apt-get upgrade

2. Add the PHP repository (by Ondřej Surý):

$ apt-get install software-properties-common
$ add-apt-repository ppa:ondrej/php

3. And finally, update your package list:

$ apt-get update

4. Install PHP 8.0 with the following command:

$ apt-get install php8.0

5. To check if PHP 8.0 is installed on your server, run the following command:

$ php -v

6. Install PHP 8.0 modules (extensions)

You may need additional packages and modules depending on your applications. The most commonly used modules can be installed with the following command:

$ apt-get install libapache2-mod-php8.0 php8.0-fpm libapache2-mod-fcgid php8.0-curl php8.0-dev php8.0-gd php8.0-mbstring php8.0-zip php8.0-mysql php8.0-xml


How to change the PHP version you're using ?

If you have multiple PHP versions installed on your Ubuntu server, you can change what version is the default one.

1. To set PHP 7.4 as the default, run:

$ update-alternatives --set php /usr/bin/php7.4

2. To set PHP 8.0 as the default, run:

$ update-alternatives --set php /usr/bin/php8.0

3. You can verify what version of PHP you’re using with the following command:

$ php -v


Check Uptime on Ubuntu Linux Server - How to do it ?

This article covers how to easily print out the uptime on any Linux distribution such as Debian and Ubuntu. You will learn how to easily perform an audit of your system's uptime. It's an important command for system administrators to know how long the system has been running. Uptime tool helps troubleshooting issues related to power and scheduling.


On any UNIX-like system, the uptime command will come pre-installed. That applies to Ubuntu as well. Verify the existence of the tool by running these commands:

$  which uptime
$ uptime --version


To check the system uptime, run the following command:

$ uptime


Install PHP 7.3 on Ubuntu 18.04 - Step by Step Process ?

This article covers how to install PHP 7.3 on Ubuntu 18.04 server. Also, you will learn how to configure PHP with Apache and Nginx web servers. 


How to Install PHP 7.4 on Ubuntu ?

Use the following set of commands to enable PPA for PHP 7.4 in your Ubuntu system and install it. You can use this version for production use also.

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install -y php7.4

Now use the following command to check installed php version on your system.

$ php -v 


How to Install PHP 7 Modules ?

You can install the required PHP modules on your system as below command:

$ sudo apt-get install php7.2-mysql php7.2-curl php7.2-json php7.2-cgi php7.2-xsl


Secure Nginx with Let's Encrypt on Ubuntu 18.04 - How to do it ?

This article covers how to install certbot client, obtain Let's Encrypt SSL certificate and configured to Nginx to use the certificates. Also, you will learn how to set up a cronjob for automatic certificate renewal.

Let's Encrypt is a Certificate Authority (CA) that provides an easy way to obtain and install free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. 


To Install Certbot on Ubuntu:

1. First, add the repository.

$ sudo add-apt-repository ppa:certbot/certbot

You'll need to press ENTER to accept.

2. Install Certbot's Nginx package with apt:

$ sudo apt install python-certbot-nginx


Configure Nginx Server Blocks on Ubuntu 18.04

This article covers how to create an Nginx server blocks to host multiple website on a single Ubuntu machine. When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server.


Install phpMyAdmin with Apache on Ubuntu 18.04 - Step by Step Process ?

This article covers how to install phpMyAdmin with Apache on Ubuntu 18.04 system. While many users need the functionality of a database management system like MySQL, they may not feel comfortable interacting with the system solely from the MySQL prompt. phpMyAdmin was created so that users can interact with MySQL through a web interface. 


Important php packages includes:

  • php-mbstring: A module for managing non-ASCII strings and convert strings to different encodings.
  • php-zip: This extension supports uploading .zip files to phpMyAdmin.
  • php-gd: Enables support for the GD Graphics Library.
  • php-json: Provides PHP with support for JSON serialization.
  • php-curl: Allows PHP to interact with different kinds of servers using different protocols.