How to Install PHP 8.3 on Ubuntu 24.10

To install PHP 8.3 on Ubuntu 24.10, follow these steps.

Step 1 : Run the following command to ensure your package lists are up to date:

Step 2 Since ppa:ondrej/php does not officially support non-LTS Ubuntu versions, you'll need to modify it manually:

- Add the PHP repository:

- Open the source file:

- Find the word oracular and replace it with noble

- Save and close the file.

Step 3 : Update the package lists to reflect the changes:

Step 4 : To ensure the correct version of the libgd3 package is used, create a preferences file with specific pinning settings:

Add the following lines:

Save and close the file.

Step 5 : Install the PHP 8.3 core packages:

Step 6 : Install frequently used PHP extensions:

- mysql: Enables PHP to interact with MySQL databases.

- curl: Allows PHP to send HTTP requests.

- xsl: Supports XSLT transformations for XML processing.

- gd: Provides image processing capabilities.

- common: Includes essential core PHP modules.

- xml: Adds XML parsing and handling functionality.

- zip: Enables PHP to work with ZIP archives.

- soap: Supports SOAP-based web services.

- bcmath: Provides precision math operations.

- mbstring: Handles multibyte string operations.

- gettext: Adds support for localization and translations.

- imagick: Extends image manipulation features.

Step 7 : Check the installed PHP version to confirm successful installation:

Congratulations! You have successfully installed PHP 8.3 on Ubuntu 24.10.