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.
[email protected]:~# 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.
[email protected]:~# apt update && -y apt upgrade
Then Install Mysql 8.0 and Apache using below command.
[email protected]:~# apt install -y apache2 mysql-server
Step #02: Install php 8.0 on Ubuntu 21.04.
[email protected]:~# apt install -y apt-transport-https lsb-release ca-certificates [email protected]:~# add-apt-repository ppa:ondrej/php [email protected]:~# apt update [email protected]:~# apt install -y php8.0 libapache2-mod-php8.0 [email protected]:~# apt install -y php8.0-fpm libapache2-mod-fcgid [email protected]:~# a2enmod proxy_fcgi setenvif [email protected]:~# a2enconf php8.0-fpm [email protected]:~# 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.
[email protected]:~# apt install -y php libapache2-mod-php php-mysql
Step #03: Check php working properly.
Open or create php file.
[email protected]:~# vi /var/www/html/info.php
Insert below text into this file.
<?php phpinfo(); ?>
Restart Apache and Mysql service.
[email protected]:~# systemctl restart apache2 [email protected]:~# 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 Odoo 16 on Ubuntu 22.04 - May 14, 2023
- 12 Steps to Organize Photos on Your Computer - March 20, 2023
- 9 Ways to Speed Up Your MacBook Yosemite - February 21, 2023
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!