Linux is a very popular environment for [PHP + Apache] server configuration. Ubuntu is a one of popular operating system in Linux family. In this post, i am going to describe the steps for installing PHP 7.3 with Apache2.
Before we start, ensure that your system packages are upto-date. Run theĀ below to commands to perform system package update and upgrade.
sudo apt update sudo apt upgrade
This will update the package index and update the installed packages to the latest version.
PHP 7.3 is a not available on Ubuntu 18.04 default repositories. 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
If you encounter the error, sudo: add-apt-repository: command not found
, install the following package to fix it.
sudo apt install software-properties-common
Now, re-synchronize your system packages to the latest versions.
sudo apt update
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.
php -v
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
Now you have successfuly installed PHP 7.3 on Ubuntu.