How to install PHP 7.3 on Ubuntu 18.04. In this tutorial, we will show you how to install PHP 7.3 on Ubuntu 18.04.

The latest PHP 7.3 version has been officially released on December 6th, 2018. It comes with a number of new features and a few incompatibilities that you should be aware of before upgrading from the previous version.

This installation tested on Google Cloud Platform with a Compute Compute Engine VM Instance. This set up will work on all servers.


  1. A Ubuntu server set up with sudo privileges.
  2. Completed the initial Ubuntu server setup.

If you are using Google Cloud Platform to install PHP you need the following steps to be done.

  1. A running Compute Engine, see the Setting up Compute Engine Instance with Ubuntu 18.04.

PHP 7.3 can also be installed on other cloud platforms. You can choose anyone from the below.

Here are some options with pricing details.

PlatformMachine TypeCost (Monthly)
Digitalocean1GB RAM – 1vCPU$5
Google Cloud PlatformMicro 600 MB RAM$4.8
Amazon Web ServicesT1-Micro 1 GB RAM$14

Getting Started

Make sure your Ubuntu server is having the latest packages by running the following command.

sudo apt update
sudo apt upgrade

This will update the package index and update the installed packages to the latest version.

Add PPA for PHP 7.3

Add the ondrej/php which has PHP 7.3 package and other required PHP extensions.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Once you have added the PPA you can install PHP 7.3.

Install PHP 7.3 FPM for Nginx

Execute the following command to install PHP 7.3 FPM

sudo apt install php7.3-fpm

After the installation has completed, confirm that PHP 7.3 FPM has installed correctly with this command

php-fpm7.3 -v

Install PHP 7.3 for Apache

Execute the following command to install PHP 7.3

sudo apt install php7.3

After the installation has completed, confirm that PHP 7.3 has installed correctly with this command

php -v

Install PHP 7.3 Extensions

Installing PHP extensions are simple with this syntax.

sudo apt install php7.3-extension_name

Now, install some commonly used php-extensions with the following command.

sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y

Configure PHP 7.3 FPM

Now that PHP 7.3.* has installed and you need to configure the user and group that the service will run under.

sudo nano /etc/php/7.3/fpm/pool.d/www.conf

Change the following lines by replacing the www-data with your username.

user = username 
group = username
listen.owner = username = username

Adjusting PHP.ini File

Now we configure PHP for Web Applications by changing some values in php.ini file.

PHP 7.3
sudo nano /etc/php/7.3/apache2/php.ini

sudo nano /etc/php/7.3/fpm/php.ini

Hit F6 for search inside the editor and update the following values.

upload_max_filesize = 32M 
post_max_size = 48M
memory_limit = 256M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000

Hit CTRL+X and Y to save the configuration and check if the configuration is correct and restart PHP.

sudo php-fpm7.3 -t 
sudo service php7.3-fpm restart

Now you are having PHP 7.3 Installed and configured.


Now you have learned how to install PHP 7.3 on your Ubuntu server.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Where Writing Meets Entrepreneurship!

Get FREE Google Cloud Tutorials.
Please help us get 1000 likes in Facebook. Thank You!

Stay Connected!

Get latest tutorials on Google Cloud and Open Source topics