How To Install PHP 8.0 Apache Mysql 8.0 On Ubuntu 21.04 Server3 min read
In this tutorial how to install php 8.0, Apache and Mysql 8.0 on Ubuntu 21.04 server. Ubuntu 21.04 is latest release. So let’s start see LAMP server using Ubuntu 21.04.
★ How To Configure LAN and WAN Interface On VyOS Router
★ How To Install OpenProject On Ubuntu 16.04
My Server info:
############################# IP Address : 10.66.100.12 OS : Ubuntu 21.04 RAM : 2GB vCPU : 2 Disk : 50 GB Mysql : v8.0 PHP : v8.0 Service : LAMP #############################
Step #01: Check server version and ip address.
root@LAMP:~# lsb_release -a && ip r
Output as like below.
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 21.04 Release: 21.04 Codename: hirsute default via 10.66.100.10 dev enp0s3 proto dhcp src 10.66.100.12 metric 100 10.66.0.0/16 dev enp0s3 proto kernel scope link src 10.66.100.12 10.66.100.10 dev enp0s3 proto dhcp scope link src 10.66.100.12 metric 100
Then must be server update and upgrade using below command.
root@LAMP:~# apt update && -y apt upgrade
Then Install Mysql 8.0 and Apache using below command.
root@LAMP:~# apt install -y apache2 mysql-server
Step #02: Install php 8.0 on Ubuntu 21.04.
root@LAMP:~# apt install -y apt-transport-https lsb-release ca-certificates root@LAMP:~# add-apt-repository ppa:ondrej/php root@LAMP:~# apt update root@LAMP:~# apt install -y php8.0 libapache2-mod-php8.0 root@LAMP:~# apt install -y php8.0-fpm libapache2-mod-fcgid root@LAMP:~# a2enmod proxy_fcgi setenvif root@LAMP:~# a2enconf php8.0-fpm root@LAMP:~# systemctl restart apache2
Setup Mysql root password, remember default root password is blank.
mysql_secure_installation
Must be use password strength like include capital latter, special character and number.
Install some required package like below.
root@LAMP:~# apt install -y php libapache2-mod-php php-mysql
Step #03: Check php working properly.
Open or create php file.
root@LAMP:~# vi /var/www/html/info.php
Insert below text into this file.
<?php phpinfo(); ?>
Restart Apache and Mysql service.
root@LAMP:~# systemctl restart apache2 root@LAMP:~# systemctl restart mysql
Insert below text into this file.
Then access server ip address like below.
http://10.66.100.12/info.php
See example like below.
If you see any error so please see my YouTube channel for more details.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!