Wordpress only works in mod_php mode

8 posts / 0 new
Last post
#1 Wed, 03/23/2016 - 04:51
cs10

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, Craig

Thu, 11/23/2017 - 20:22
Matth
Matth's picture

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

Kindly

Matth

Wed, 11/29/2017 - 00:42
tpnsolutions
tpnsolutions's picture

Hi,

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

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Wed, 11/29/2017 - 07:58
Matth
Matth's picture

Hello,

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 Matth

Matth

Wed, 11/29/2017 - 08:35
scotwnw

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.

Wed, 11/29/2017 - 15:25
tpnsolutions
tpnsolutions's picture

Hi,

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.

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Thu, 12/07/2017 - 06:41
Matth
Matth's picture

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 modeto 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.

Thanks

Matth

Tue, 12/19/2017 - 12:43
tpnsolutions
tpnsolutions's picture

Hi,

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:

http://software.virtualmin.com/gpl/scripts/install.sh

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.

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Topic locked