Installing Apache and PHP 8.1 on Ubuntu 21.10 x64. This post covers creating an HTTP web server using Apache with the new PHP 8.1 version.
You will need sudo permissions for this.
Start by updating the package list with
sudo apt update
Once that has finished running, install apache2
sudo apt install apache2
Apache is the number one, open-sourced HTTP server and comes ready to use.
If you have UFW (firewall) running you will need to allow Apache through
sudo ufw allow 'Apache'
You can check Apache’s status with
sudo systemctl status apache2
This will tell you if Apache is running or not.
PHP version 8.1 was released November 25th 2021, as of this blog post the latest version is 8.1.1
You may need to install the independent software sources, this can be done with
sudo apt install software-properties-common
This is needed for the latest PHP versions repository
sudo add-apt-repository ppa:ondrej/php
sudo apt install php8.1 libapache2-mod-php8.1
Installing PHP 8.1 extensions is done in the following format:
sudo apt install php8.1-[extension_name]
An example with a few common extensions
sudo apt install php8.1-{curl,mysql,xml} Restart Apache
sudo systemctl restart apache2
Check and confirm the PHP version
php -v
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…