This tutorial guides you through the process of installing PHP 8.3 on Rocky Linux 8, ensuring you have access to the latest PHP features for your development projects.
rocky linuxphp
Large
VPS
3
vCPU
12 GB
Memory
120 GB
NVMe Disk
6144 GB
Traffic
29.90€
/month
* Up to 6 vCPU, 36GB RAM, 360GB NVMe Disk Space and 1Gbit/s Network Speed
#### Prerequisites
Before you begin, ensure you have:
- A server or workstation running Rocky Linux 8
- A user account with sudo privileges
- Basic familiarity with the command line
#### Step 1: Add Remi Repository
Install the Remi repository, which provides the latest PHP versions:
```bash
sudo dnf install -y dnf-utils
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
```
#### Step 2: Enable PHP 8.3 Repository
Enable the PHP 8.3 repository:
```bash
sudo dnf module enable php:remi-8.3 -y
```
#### Step 3: Install PHP 8.3
Install PHP 8.3 and necessary PHP extensions:
```bash
sudo dnf install -y php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-json
```
#### Step 4: Verify PHP Installation
Check the installed PHP version:
```bash
php --version
```
You should see output similar to:
```
PHP 8.3.x (cli) (built: ...)
```
#### Step 5: Configure PHP (Optional)
Adjust PHP settings as needed in the php.ini configuration file located at `/etc/php.ini`.
#### Step 6: Test PHP
Create a simple PHP script to test your installation:
```bash
echo "" | sudo tee /var/www/html/info.php
```
Access `http://your_server_ip/info.php` from a web browser to see PHP information.
#### Conclusion
You have successfully installed PHP 8.3 on Rocky Linux 8, allowing you to leverage the latest PHP capabilities for your development needs.
**Additional Resources:**
- **PHP Official Documentation:** [https://www.php.net/docs.php](https://www.php.net/docs.php)
- **Remi Repository Documentation:** [https://rpms.remirepo.net/](https://rpms.remirepo.net/)
- **Rocky Linux Documentation:** [https://docs.rockylinux.org/](https://docs.rockylinux.org/)
Let me know if there's anything else you'd like to know or if you'd like to proceed with another tutorial!