To install PHP 8.2 for Apache on Ubuntu 23.10, you can follow these steps:
Step 1 : Update Package Lists
Before installing PHP and Apache packages, make sure your package lists are up-to-date:
Step 2 : Install the core PHP 8.2 package with Apache Module:
Step 3 : Install PHP Extensions
- cgi : Common Gateway Interface
- mysql: Provides support for MySQL database connections in PHP.
- curl: Enables support for cURL, a library for making HTTP requests.
- xsl : Adds support for XSLT, a language for transforming XML documents.
- gd : Supports the GD library for dynamic image creation.
- common: Installs common PHP modules and settings.
- xml: Adds support for XML parsing and manipulation in PHP.
- zip: Provides functionality for handling ZIP archives.
- soap: Enables the Simple Object Access Protocol (SOAP) for web services.
- bcmath : Supports arbitrary precision mathematics.
- mbstring (Multibyte String): Adds support for handling multibyte character encodings.
- gettext: Enables internationalization functions for PHP.
- imagick: Integrates ImageMagick, allowing PHP to create, edit, and compose bitmap images.
Step 4 : Verify PHP Installation
Check the PHP version installed:
You should see output similar to the following, indicating the PHP version and additional information:
Step 5 : Configure Apache to Use PHP
Enable the PHP module:
Step 6 : Restart Apache
After making changes to the Apache configuration, restart the Apache service:
Step 7 : Test PHP
Create a test PHP file in the default web directory:
Access this file in a web browser (replace your_server_ip
with your server's IP address):
You should see the PHP information page if everything is set up correctly.
You've successfully installed PHP 8.2 for Apache on Ubuntu 23.10.