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

How To Upgrade Ubuntu To 22.04 LTS Jammy Jellyfish

Ubuntu 22.04 LTS Jammy Jellyfish is due to release on April 21, 2022. However, users of Ubuntu 20.04 and Ubuntu 21.10 are able to upgrade to the latest release right now.

Upgrade MySQL from 5.7 to 8 on Ubuntu 18.04

In this article we will upgrade MySQL on Ubuntu 18.04 LTS from version 5.2.27 to 8.x using command line. Step […]

website hosting

Facts of Different Types of Web Hosting Services

Contents1 10 Different Types of Web Hosting1.0.1 Typically, web hosting requires the following:1.0.2 Types of hosting1.0.3 Hosting Management1.0.4 Reliability and […]