My Blog List


Thursday, March 6, 2025

Installing PHP 7.4 on Latest Ubuntu

 

Installing PHP 7.4 on Latest Ubuntu

PHP 7.4 has reached its end of life, but some applications may still require it for compatibility reasons. If you need to install PHP 7.4 on the latest Ubuntu systems, follow the steps below. 


Installing PHP 7.4 on Ubuntu

Install required dependencies:

sudo apt -y install software-properties-common

Add the Ondřej Surý PPA:

sudo add-apt-repository ppa:ondrej/php

Update package lists:

sudo apt update

Install PHP 7.4 and necessary extensions:

sudo apt install -y php7.4 libapache2-mod-php7.4 php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip,cli,fpm,opcache,xml,curl,xsl,soap,json,apcu,imap,xmlrpc}

Final Steps

After installation, verify the PHP version:

php -v

You should see output confirming PHP 7.4 is installed. If using Apache, restart the service:

sudo systemctl restart apache2

No comments:

Post a Comment