How to Install PHP 8.3 on Ubuntu 23.10

To install PHP 8.3 on Ubuntu 23.10, you can use the following steps:

Step 1 : Update Package Lists:

Make sure your package lists are up-to-date:

Step 2 : Install Software Properties Common

Install the software-properties-common package to add the PPA repository:

Step 3 : Add the Repository.

Ondrej's PPA doesn't support non-LTS versions of Ubuntu. Nevertheless, we can proceed with the installation by following the steps below.

Step 4 : Open '/etc/apt/sources.list.d/ondrej-ubuntu-php-mantic.sources'.

Replace 'mantic' with 'jammy'

Step 5 : Run the update command again

Step 6 : Create a preference file for Ondrej's PHP repository by creating the file '/etc/apt/preferences.d/ondrejphp' and adding the following content:

Step 7 : Install PHP 8.3

Step 8 : Install Additional PHP Extensions

- php8.3-mysql: MySQL extension

- php8.3-zip: Zip extension

- php8.3-gd: GD extension

- php8.3-mbstring: Mbstring extension

- php8.3-curl: cURL extension

- php8.3-xml: XML extension

- php8.3-bcmath: BCMath extension

- php8.3-soap: SOAP extension

- php8.3-gettext: Gettext extension

Step 9 : Check PHP Version

Verify that PHP 8.3 is installed by running:

Step 10 : Configure PHP (Optional)

Adjust the PHP configuration if needed. The configuration files are usually located at /etc/php/8.3/cli/php.ini and /etc/php/8.3/fpm/php.ini.

Now you have PHP 8.3 installed on your Ubuntu 23.10 system.