How to Update PHP 7.2 to 7.3 on Ubuntu 18.04 / 20.04 Easily

As a region of accelerating the protection, it's suggested to stay your PHP version up up to now. Here we've got provided the steps to upgrade this PHP 7.2 version to 7.3 on Ubuntu 14/16/18 versions while not removing the recent one. so we are able to revert to the older versions if one thing incompatible with the new one once shift.

  1. Login to the server via SSH as root.
  2. Check your current PHP version. 
    # php -v
    PHP 7.2.36
  3. In order to install PHP 7.3, we need to add the repository first:
    # add-apt-repository ppa:ondrej/php
  4. Then run an update:
    # apt-get update
  5. After completing the update, we need to install the PHP 7.3.
    # apt install php7.3 
  6.  Then install the required PHP packages based on your current installation:
    # apt install php7.3-common php7.3-cli php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-readline php7.3-xml php7.3-zip php7.3-fpm php7.3-bcmath php7.3-mbstring
  7. After a successful installation, we can disable the old 7.2 and then enable 7.3:
    # a2dismod php7.2
    # a2enmod php7.3
  8. Then restart Apache:
    # service apache2 restart
  9. The new PHP version should be active now. You can verify it from the command line:
    # php -v
     PHP 7.3.28
  • ubuntu upgrade php
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Most common reasons for a site to be down

The most common reason for a web-site to be down can be separated on few major categories. The...

What about DDoS attacks? Can you protect us from those?

Yes and no. Unfortunately, the succes of a Denial-of-Service attack is largely dependent on the...

Do you guarantee that our site will never be hacked ?

No, as many aspects of this are, to a large degree, far beyond our control. For example, your IT...

Difference between window and linux Server

Windows hosting and Linux Hosting Packages operate on different operating systems. Although...

Backup policy, Do you provide backups?

You are responsible for your backups and web content. We create our own weekly backups on the...