From last few days, I was facing a strange issue. I installed all the requirements for LAMP(Linux Apache MySQL PHP) and tried to run the PHP script but don’t know why it was not working. All the time just getting the raw content of the PHP scripts.
After digging and spending lots of time on searching this issue, I got a workaround which seems working to me. Here are the steps,
sudo dnf update
MySQL
sudo dnf install mysql-server mysql mysql-community-server
systemctl start mysqld.service
systemctl enable mysqld.service
/usr/bin/mysql_secure_installation
httpd(Apache)
sudo dnf install httpd
sudo systemctl start httpd.service
sudo systemctl enable httpd
firewall-cmd –permanent –add-service=http
firewall-cmd –permanent –add-service=https
firewall-cmd –reload
PHP
sudo dnf install php php-mysql -y
sudo systemctl restart httpd.service
sudo systemctl reload firewalld
.conf file
sudo vim /etc/httpd/conf.d/project.conf
// Contents of project.conf file
Restart apache
sudo systemctl restart httpd.service
Now you can access project.dev or project-alias.dev in your browser.