#Introduction
In this tutorial, How to Install LAMP Stack on Rocky Linux
Install Apache on Rocky Linux
dnf install -y httpd httpd-devel httpd-tools
Enable apache start at boot time
systemctl enable httpd
start the Apache HTTPd daemon
systemctl start httpd
To check apache running on Rocky Linux
systemctl status httpd
The output terminal as below

Opens a browser that can access your Server’s IP address
http://Your-IP-address
OR
http://domain.com

Install MariaDB on Rocky Linux
dnf install mariadb-server mariadb
The output terminal as below

Enable MariaDB start at boot time
systemctl enable --now mariadb
start the MariaDB daemon
systemctl start mariadb
To check MariaDB running on Rocky Linux
systemctl status mariadb
Additional steps to harden the database server.
mysql_secure_installation
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Install PHP on Rocky Linux
The default PHP stream is PHP 7.2
To install the latest module Stream. We will reset the PHP streams.
dnf module reset php
Install PHP 7.4
dnf module install php:7.4
The output terminal as below

Install additional PHP extensions
dnf install php-cli php-gd php-curl php-zip php-mbstring php-opcache php-intl php-mysqlnd
Confirm the version of PHP installed
php -v
The output terminal as below

We create a test PHP file in the /var/www/html path.
vi /var/www/html/info.php
The content info.php as below
<?php
phpinfo();
?>
Save the changes and restart the webserver.
systemctl restart httpd
Open back browser
http://server-ip/info.php
The output as below

Remove file test PHP
rm -f /var/www/html/info.php
Conclusion
You have to Install LAMP Stack on Rocky Linux. I hope will this your helpful. Thank you for reading the DevopsRoles page!