Apache not running PHP scripts on fedora-23

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

screenshot-from-2016-12-25-01-50-01

Restart apache

sudo systemctl restart httpd.service

Now you can access project.dev or project-alias.dev in your browser.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s