How to Install PHP 8.3 for Nginx on Ubuntu 24.10

To install PHP 8.3 for Nginx on Ubuntu 24.10, follow these steps:

Step 1 : Update your package lists to ensure the latest versions:

Step 2 : Search for available PHP 8.3 packages using:

Step 3 : Install the necessary core packages for PHP 8.3:

Step 4 : Install frequently used PHP extensions:

- mysql: For database interactions.

- curl: For making HTTP requests.

- xsl: For XML transformations.

- gd: For image manipulation.

- common: Core libraries.

- xml: For handling XML data.

- zip: For managing ZIP archives.

- soap: For SOAP-based web services.

- bcmath: For arbitrary precision mathematics.

- mbstring: For multibyte string processing.

- gettext: For localization support.

- imagick: For advanced image processing.

Step 5 : Check the installed PHP version:

Step 6 : Edit the Nginx site configuration:

Add the following within the server block:

Step 7 : Create a symbolic link to enable your site.

Step 8 : Check Nginx configuration for syntax errors:

Step 9 : Restart Nginx to apply changes:

Step 10 : Create a test file to verify PHP:

Add the following content:

Access the test file in your browser:

Congratulations! You have successfully installed and configured PHP 8.3 with Nginx on Ubuntu 24.10.