• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Web server return file to download for .PHP file

F

flupke

Guest
don't know after what upgrade this happens, this is new since 2 weeks:

PHP file are not displayed anymore but returned to the browser as a file to download!


There are many consequences like it is now impossible to access to the stats anymore, browser asks 'do you want to download xxxx.php'? With Firefox it is even worst: it enters an infinite loop and opens a new tab after each other

Incredible this story, any advise welcome.

NB: happens for all he domains
 
The same happens to me after i upgraded to plesk 8.2
If i fix i will tell you how.

Jose
 
config problem

Verify the following in Apache's config:

$ grep Type /etc/httpd/conf.d/php.conf
AddType application/x-httpd-php .php

If this is good, then you might also try a simple restart of the Apache server (httpd).
 
doesnt help. In fact the webstat file is an .html file without any PHP script in it.

all domains impacted! .html files in the httpdocs directory are ok.
 
I observed the same thing and the solution was (or I think at least) to remove httpd.conf from /etc/httpd/conf/
I saw there that now PLESK do near httpd.conf a file psa*_httpd.conf file and initially I though that is a copy and for some misconfiguration cannot delete it. Initially I deleted this file psa*_httpd.conf but all the times was there. Then on a new server with PLESK 8.2 I saw that is used only this one, psa*_httpd.conf and NO httpd.conf. So I deleted httpd.conf on the same server and now this PHP problems was solved.
I think that load 2 times and this is why happening this error.
So please try this (you can move to /root folder httpd.conf to have it as backup) and restart apache, then confirm if I have right or no.
 
httpd.conf is needed, as I can see it is also the file that include the psa.conf file, sitebuilder.conf file .....
 
I just installed several new servers with PLESK 8.2 and there is only zz010_psa_httpd.conf so I think on upgrades from 8.0 or 8.1 will remain there httpd.conf and is happening a collision.
 
doesn't work with 8.1, obviously httpd fails to start.

I also noticed another problem: when accessing a non-existing page on a domain, the browser also asks to download a file! The worst is that with firefox the browser enters in a loops and keep opening tabs.

I've opened a ticket.
 
Fixed i have added to httpd.conf

LoadModule php4_module /usr/lib/apache2/modules/libphp4.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
 
SWsoft fixed it, here what they did: the commented this line in both httpd.conf and php.conf

#AddType application/x-httpd-php .html


Now, I wonder why apache still processes php code in .html file, I restarted service httpd, the problem is correct (great) and I notice that .html files are still processed by apache, there is nothing in local http.include file tellin apache to do so.

How can you explain this?
 
Fixed i have added to httpd.conf

LoadModule php4_module /usr/lib/apache2/modules/libphp4.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

I restart the apache2

Thanks a lot.How can i configure apache to use php5?

Jose Galvez
 
Back
Top