PHP not executing

SYSTEM INFORMATION
OS type and version Debian GNU/Linux 9
Webmin version 1.994
Virtualmin version 7.1-1
Related packages PHP

Hi, I am running a server with Virtualmin for some time now. Recently I noticed the servers are not executing PHP scripts. The files are being output, and are downloading on the browser.

This server is primarily used for email and other stuff, so websites are served only occasionally for different purposes. This problem was not there around 1/2 months ago, which was the last time we needed to serve some pages for a project.

Over this time, we have keep maintaining the server, and the packages were upgraded as prompted by Virtualmin dashboard.

Can anyone help us, why this is happening?

I’m pretty sure that php 7.1 was end of life in 2019 and runs only in security fix mode at present. I’m not familiar with how your particular OS handles it, but I would think it needs to be upgraded.

Sounds like mod_php entries in the apache config files assuming you are using apache. I mention this as I had this problem when virtualmin upgraded to version 7. ended up manually editing the server config files to remove all traces of mod_php

Virtualmin 7.1-1 is the version I have. Where did you see PHP version 7.1? In fact, there are 5 PHP versions now: 7.0.33, 7.3.33, 7.4.29, 8.0.20 & 8.1.7

Deleted. My bad.

no worries… happens…

but my problem is, why would mod_php mess with the config? i don’t remember ever enabling it at all!

mod_php breaks other execution modes, if it is installed. Virtualmin works around it if it knows about mod_php when the domains are created (by adding a bunch of mess to each new domain to disable mod_php for that domain). But, if you installed or updated mod_php between when the domain was created, it would break those domains.

You should never install mod_php.

Edit: Note this is a function of the packages that contain mod_php. They include a configuration file that goes into the Apache conf.d which sets up handlers for PHP apps. But, because your PHP apps aren’t setup for mod_php (wrong permissions/ownership), they simply don’t work.

I have never, to my knowledge, installed mod_php.

That’s the problem: So many packages install it without telling you. It’s a real mess.

That’s just the most common cause of this problem. And, people install it all the time without realizing it…if you installed a package named php or phpVER-php, you installed mod_php.

Do the config check and validate virtual servers, which will tell you if mod_php is one of the available execution modes (and if it is, it means you installed it or did something to cause it to be installed).

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.