(Last Updated On: January 17, 2019)

How can I install PHP 7.3 on Linux Mint 19?. In December 2018, the PHP team released PHP 7.3 for general availability (GA) and all the release details are on the PHP ChangeLog page. The default version of PHP available in Linux Mint 19 repositories is PHP 7.2.

This guide will walk you through the steps to install PHP 7.3 on Linux Mint 19. For Apache web server users, you’ll install libapache2-mod-php as a dependency. But for Nginx users, you’ll install PHP 7.3-FPM instead.

For other operating systems, use:

How to Install PHP 7.3 on Arch Linux and Manjaro

How to Install PHP 7.3 on Debian 9 / Debian 8

How to install PHP 7.3 on Ubuntu 18.04 / Ubuntu 16.04 / Debian

How to Install PHP 7.3 on CentOS 7 / Fedora

Step 1: Update Linux Mint 19

Ensure you’re running an updated version of Linux Mint. If you have important programs running and don’t want to upgrade them, you can just do an update for packages list.

sudo apt update
sudo apt upgrade

It is recommended to reboot after upgrade in case you have a newer version of Kernel installed.

sudo reboot

Step 2: Add PHP 7.3 repository to Linux Mint 19

Since Linux Mint 19 is a based on Ubuntu 18.04, the repository to be added is for Ubuntu 18.04.

Add ondrej/php PPA repository which has PHP 7.3 packages and other required PHP extensions.

sudo add-apt-repository ppa:ondrej/php
sudo apt update

Step 3: Install PHP 7.3 on Linux Mint 19

Once the repository has been added, install PHP by running the commands below on your terminal.

sudo apt-get install php7.3

Version can be checked using the php - command.

$ php -v
PHP 7.3.1-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jan 13 2019 10:19:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.1-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Step 4: Installing PHP 7.3 Extensions

Install PHP 7.3 extensions by using the syntax

 sudo apt-get install php7.3-<entension-name>

See example below

sudo apt install php7.3-cli php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd  php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json

You can confirm installed version of PHP extension using apt policy command:

$ apt policy php7.3-gd
php7.3-gd:
Installed: 7.3.1-1+ubuntu18.04.1+deb.sury.org+1
Candidate: 7.3.1-1+ubuntu18.04.1+deb.sury.org+1
Version table:
*** 7.3.1-1+ubuntu18.04.1+deb.sury.org+1 500
500 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status

PHP configuration file for setting up the environment are /etc/php/7.3/cli/php.ini and /etc/php/7.3/apache2/php.ini.

Installing PHP7.3-FPM on Linux Mint

If you’re using Nginx Web Server, you’ll need to install php7.3-fpm for serving PHP pages.

sudo apt install php7.3-fpm

PHP-FPM configurations files are available under the folder/etc/php/7.3/fpm/

You may need to restart your Web server after installation of PHP.

# Apache
sudo systemctl restart apache2

# Nginx
sudo systemctl restart nginx

Have a happy PHP development and Applications hosting.