Wordpress only works in mod_php mode

I have a virtual server that I have configured and restored a wordpress backup (taken from a shared server).

To get it to work, the php execution mode has to be in mod_php.

If I set it to CGI or FCGId, when accessing the website, it just downloads a file.

By having this set to mod_php, although the website works, I get some issues when writing changes via the admin area, where permission is denied.

I think because its running as the apache user, and not the virtual server user, who is the owner of the files and folders.

Can anyone help please?

Many thanks in advance,

Hello cs10,

Did you manage to get it working ? I got the same issue and manage to get it work by installing PHP_FPM package, it’s now running properly with it.

hope that help



What operating system are you using, and how did you install Virtualmin?


I’m running Debian 9 and I’ve install Virtualmin through Webmin.
So far I didn’t manage to get WordPress working in CGI or FCGid mod it keeps requesting to download php files…

kind regards

I recently tried moving a virtualmin domain with worpdress from Ubuntu 12.04 to Clean install of Ubuntu 16.04. Similar thing happened, it would only download the php file. I dont think I tried changing it to mod_php. But I then did a clean install of wordpress in a sub folder as a test and it loaded perfectly with php-fpm. I then deleted all public_html files and tried clean wordpress from main dir. It downloaded the php again. But If I put in the /index.php in to the address bar, it loaded. So I think there’s multiple issues going on, like older Wp not liking FPM and FPM not loading index.php by default.


When installing Virtualmin, you should always install via the “install.sh” script provided on Virtualmin.com. Installing Webmin, then Virtualmin has known issues since the “install.sh” script configures everything for you in one shot, and does it the way Virtualmin needs it to work. Doing it the other way can result in the system using incorrect binaries, and other default configurations set by the Linux distribution.

If you need further assistance, drop me a line. I’ve installed Virtualmin on dozens of servers, and hundreds of times over the past few years alone.

Hi Peter,

Interesting feedback, the option to install through Webmin was available so I didn’t think about doing through an install script, but once the install done.
What would you advise ? Re-run the install or look for fixing the specific issue, personally I didn’t get that much issues.
So far most of my trouble are more Webmin related.

@scotwnw, when installing wordpress in the main dir do you use the Webmin installer script ?

Do you confirm that setting in WebSite options >> PHP script execution mode to FPM the php files gets download instead of executed ?
Personally, I’m only experiencing it with CGI and FCGI mode
Don’t try to use mod_php there is no point using it as it’s needs to run under Apache user account, and it’ a pain in the a… to set the right properly, it will most-likely lead to security issues.



For simplicity sake, I’d recommend backing up any websites you have, then doing a minimal install of the distro of choice (I recommend CentOS personally), then download the Virtualmin installer from:


Run the installer from the command line, and it’ll go through the whole Virualmin install, and configure your system with the most optimal settings.