To install PHP 8.0 on Ubuntu 24.10, follow the steps below.
Step 1 : Run the following command to update your package list:
Step 2 : Since ppa:ondrej/php
does not officially support non-LTS versions of Ubuntu, follow these steps:
- Add the repository:
- Open the repository file to edit:
- Find and replace oracular
with noble
.
- Save the file (Ctrl + O, then Ctrl + X).
Step 3 : Update the Package List Again
Step 4 : Create a preference file for libgd3
:
Add the following content:
Save and close the file.
Step 5 : Install the PHP 8.0 core packages:
Step 6 : Install useful PHP extensions:
- mysql: For interacting with MySQL databases.
- curl: For making HTTP requests.
- xsl: For XML transformations.
- gd: For image manipulation.
- common: Provides essential PHP features.
- xml: For working with XML data.
- zip: For handling ZIP archives.
- soap: For web service communication.
- bcmath: For precise mathematical operations.
- mbstring: For working with multibyte string functions.
- gettext: For translation and localization support.
- imagick: For advanced image processing.
Step 7 : Check the installed PHP version:
Congratulations! You have successfully installed PHP 8.0 on Ubuntu 24.10.