PHP pages download or display the source -
Server PHP Source download

PHP pages download or display the source

Why do my PHP pages download or display the source, rather than executing the PHP code?

If you’re seeing this issue, it’s likely that a newly installed PHP version setup some Apache configuration options that’s overriding your Virtualmin PHP settings.

It’s a simple fix though, you just need to find the offending configuration and comment it out. The configuration to look for are “SetHandler” lines — those can be found using the following:

On CentOS

find /etc/httpd -type f | xargs grep -i sethandler

On Ubuntu/Debian

find /etc/apache2 -type f | xargs grep -i sethandler

Look for any lines like the following:

SetHandler application/x-httpd-php

Note : There could be more than one — comment them all out, and then restart Apache.

And then comment that out, and restart Apache using the command service httpd restart on CentOS or service apache2 restart on Ubuntu/Debian.

Related Article

containers vs virtualmachines

Containers vs Virtual Machines

Maintaining a large software application is not an easy task since it may contains lots of dependencies and Operating System […]

UFW firewal

UFW Firewall on Ubuntu

How to Install UFW Firewall on Ubuntu with GUI? The objective is to show you how to enable and disable […]

Windows Run Commands

Useful Windows Run Commands for IT Automation

Contents1 Windows Run Command for IT Operation and Automation2 Here is a list of commands you can execute from the […]