sudo yum install httpd
sudo systemctl start httpd
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
http://your_server_IP_address
This will show Testing 123.. (it's mean working good)
sudo systemctl enable httpd.service
sudo yum install mariadb-server
# Start
sudo systemctl start mariadb
# Enable
sudo systemctl enable mariadb.service
# Check
sudo systemctl status mariadb
sudo mysql
#set user and password
GRANT ALL ON example_database.* TO 'root'@'localhost' IDENTIFIED BY '12345' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
mysql -u example_user -p
#show Databases
SHOW DATABASES;
sudo yum install php php-mysql
#restart
sudo systemctl restart httpd.service
#Check
php -v
sudo chown -R sammy.sammy /var/www/html/ #sammy is exmple. user
#Write this into the '/var/www/html/into.php'
<?php phpinfo(); ?>
#run on your browser
http://your_server_IP_address/info.php
#to Remove info.php
rm /var/www/html/info.php
PHP 7.4 is available in the EPEL (Extra Packages for Enterprise Linux) repository. You need to enable it if it's not already enabled.
sudo yum install epel-release
The Remi repository provides more recent versions of PHP.
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install php74 || sudo yum install php81
#To see which versions of php are installed
rpm -qa | grep php
#restart the `Apache`
sudo systemctl restart httpd
sudo alternatives --set php /usr/bin/php74
#if cann't access
sudo ln -sf /usr/bin/php74 /usr/bin/php
sudo ln -sf /usr/bin/php74 /usr/bin/php-cgi
Then Restart Apache and Check PHP version