To install PHP 8.3 on Ubuntu 22.04, you can follow these steps:
Step 1 : Update the package list to ensure you have the latest information about available packages:
Step 2 : Install the software-properties-common
package, which provides utilities for adding and managing software repositories:
Step 3 : Add the PHP repository maintained by Ondřej Surý:
Step 4 : Update the package list again to include the new repository:
Step 5 : Install PHP 8.3:
Step 6 : Install Commonly Used Extensions for PHP 8.3
- mysql: This extension enables PHP to interact with the MySQL database. It provides functions to perform queries and manipulate data within the MySQL database.
- curl: CURL is a powerful library for creating and handling HTTP requests. The curl extension allows PHP to perform HTTP requests and access resources on the web.
- xsl: XSL is a stylesheet language for XML, allowing you to transform and present XML data as desired. The xsl extension enables PHP to transform XML data using XSLT rules and templates.
- gd: GD is a graphics library in PHP that allows for image creation, manipulation, and output. It supports various image formats and basic image processing functions like cropping, rotating, and editing.
- common: In PHP documentation, common extensions refer to a set of frequently used extensions, including fundamental ones like bcmath, calendar, ctype, date, filter, hash, json, pcre, Reflection, SPL, standard, and zip.
- xml: This extension provides functions for processing XML data, including parsing and creating XML documents.
- zip: The ZIP extension allows PHP to compress and decompress files and directories using the popular ZIP compression format.
- soap: The SOAP (Simple Object Access Protocol) extension enables PHP to interact with web services via the SOAP protocol. It facilitates sending and receiving data between applications over the network.
- bcmath: The bcmath extension offers accurate mathematical functions for large number calculations.
- mbstring: The mbstring (MultiByte String) extension provides functions for handling and displaying multibyte strings, supporting various character sets and encodings.
- gettext: This extension supports translation and multilingualism by providing functions for extracting and displaying translated text.
Step 7 : Check the installed PHP version:
You've successfully installed PHP 8.3 on Ubuntu 22.04