• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved One domain downloads php files instead of executing them

Mike_CX

New Pleskian
Hello,

I got a problem with a domain on Plesk 12.5.
When I try to open a php file which is hosted on a particular domain (and only there!) my browser offers me to download the file. Other domains inside the same subscription and other domains on other subscriptions are not affected, it's only on this one domain. PHP is activated for this domain, and always was and worked until now, so this seems a little strange.
I already tried to fix it by running the following command:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain mydomain.com

The httpd.conf which belongs to the domain (in the conf folder next to the httpdocs and log folders) changed in size and date, so I think Plesk did something to the config. After restarting the Apache service (I think this is necessary after modifying a httpd.conf file, isn't it?) I tried it again and nothing changed, php files still are offered to be downloaded.

As I am new to Plesk I don't have any idea what else I could to, i.e. which config files I could check. I want to avoid setting up the whole subscription from scratch as there are a lot of email accounts and other domains (that forward to this one) involved which I would have to recreate then. Or is it possible to back up only the email and domain stuff and restore it after the domain is recreated?

Thanks for your help!

Regards, Mike
 
Which php handler is used for this domain? 'FPM application served by Apache' of something else? Have you tried to change handler? Any results?
 
Hello Igor,

thanks for your reply.
The handler is set to FPM. I switched it to fastCGI, restarted Apache and: it worked!
Then I switched back to FPM, restarted Apache again and tried it again: problem comes back
So there seems a problem with FPM for this domain, as all other domains run fine with FPM.
Can I run into any problems when I leave it at fastCGI, or is there even a solution how FPM for this domain can be fixed?
Thanks!

Regards, Mike
 
Make sure that proxy_fcgi_module and proxy_module are enabled and loading by apache. You can check it with following command:

# apachectl -M | grep -E 'proxy_module|proxy_fcgi'
 
Hello Igor,

I get the following output:
proxy_module (shared)
proxy_fcgi_module (shared)

What can I do next?
Thanks!
 
Hello Igor,

I can find the section with <IfModule mod_proxy_fcgi.c> in the httpd.conf twice and it looks the same (of course the domain name differs).
When running plesk sbin httpd_modules_ctl -s | grep proxy_fcgi proxy_fcgi on I get:
grep: proxy_fcgi: No such file or directory
grep: on: No such file or directory

Do I have to run this in a particular folder?

When checking for custom templates I get an error that the specified path doesn't exist, so I think there are no custom templates.

The command apt-get check doesn't show any errors:
Reading package lists... Done
Building dependency tree
Reading state information... Done
 
When running plesk sbin httpd_modules_ctl -s | grep proxy_fcgi proxy_fcgi on I get:
grep: proxy_fcgi: No such file or directory
grep: on: No such file or directory
There is mistake in command. Use:

# plesk sbin httpd_modules_ctl -s | grep 'proxy_fcgi on'
 
Hello,

I resolved a similar problem by running:
Code:
/usr/local/psa/admin/sbin/autoinstaller --select-release-current --upgrade-installed-components

This upgraded the following packages:
libapache2-mod-proxy-psa plesk-mail-pc-driver psa-phpfpm-configurator
 
The fact that this can just start happening by itself on autoupgrade is a huge security vulnerability

Users can download all the sensitive files once apache is in this broken state including .env, wp-config.php
 
Back
Top