How to Install PHP8.4 on Ubuntu 24.04

Step 1: Update System Packages

Start by updating your package list:

sudo apt update && sudo apt upgrade -y

This ensures you have the latest package information and system updates.

Step 2: Install Required Dependencies

Install the necessary packages for adding PPAs:

sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https -y

These packages allow you to securely add external repositories to your system.

Step 3: Add Ondřej Surý PPA Repository

Add the official PHP PPA maintained by Ondřej Surý:

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

This repository is trusted by the PHP community and provides the latest PHP versions for Ubuntu systems.

Step 4: Update Package List Again

Refresh your package list to include the new repository:

sudo apt update

Step 5: Install PHP 8.4

Now you can install PHP 8.4 with this simple command:

sudo apt install php8.4 -y

The installation process typically takes 2–3 minutes, depending on your internet connection.

Step 6: Verify PHP 8.4 Installation

Check if PHP 8.4 Ubuntu 24.04 installation was successful:

php -v

You should see output similar to:

PHP 8.4.0 (cli) (built: Nov 21 2024 15:37:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.0, Copyright (c) Zend Technologies

Method 2: Install PHP 8.4 with Common Extensions

For web development, you’ll need additional PHP extensions. Here’s how to install PHP 8.4 with the most commonly used extensions:

Essential PHP Extensions

Install PHP 8.4 with essential extensions:

sudo apt install php8.4 php8.4-cli php8.4-common php8.4-curl php8.4-mbstring php8.4-mysql php8.4-xml php8.4-zip php8.4-gd php8.4-intl php8.4-bcmath -y

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Need Help ? Call Our award-winning support team 24/7 at 01-4983900

© 2023 All right reserved to sobiztrend.com