• 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

webstats application/x-httpd-php

P

poobaah

Guest
Hi,

I have a rather very strange problem with webstat on all my hosted sites.

I changed the file /etc/httpd/conf/httpd.conf by adding the line:

AddType application/x-httpd-php .php .htm .html

I did this to allow the parsing of php in html files, however when I try to access
http://my_domain.com/plesk-stat/webstat it wants to download a file rather than displaying the stats.

I am not sure if the 2 are related, but it is an annoying problem and after hours of googling I still am no closer to an answer.

Any ideas would be greatly appreciated.

Paul.
 
This seems to be a problem with mime types, although I am not sure how to resolve it.
Thanks,
Paul.
 
I'm having the same problem.

I'm having the same problem. None of the standard fixes are working. It's like PHP isn't picking up on the type... could this be some customization of apache or php, or maybe just a strange configuration?

I'll be looking through the httpd.conf (and friends) and I'll let you know if find anything useful. This problem is very perplexing.
 
I also posted this problem as a ticket with the hosting company I use, and the techs at sw-soft ended up re-installing webalizer and simply removing the directive "AddType application/x-httpd-php .php .php3 .html" that I added to httpd.conf.

In other words they put it back to the original setup. It seems I have to add the .php extension to any pages I want parsed as php. I guess this is more efficient anyway.

Hope this helps.
Paul.
 
A Better Way :)

Probably this is what you mean.
On my server I have many domains, i want to execute php's in the webstat directory, so add to the end of your httpd.conf
/etc/apache2/httpd.conf
(apache's conf, wherever it is)

<Directory "/home/httpd/vhosts/*/statistics/webstat">
Options Indexes MultiViews ExecCGI
Order allow,deny
Allow from all
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "/home/httpd/vhosts/"
</IfModule>
AddType application/x-httpd-php .html
</Directory>
 
Well, that's how it's supposed to work, but for some reason I can't pinpoint, PHP just isn't processing files with .html exensions, no matter what. In short, if the directive:

AddType application/x-httpd-php .html

is in there anywhere (regardless of context, so long as it's applied), the browser asks me to download the file (because the type is still application/x-httpd-php). When I do, I see php source. I understand how disgustingly wrong this is, but that's the behaviour. I can't find what's causing it.

I suspect that either the PHP just doesn't care about the MIME type, or the apache2 config is so spaghettied that the PHP phase is long over by the time the directive is applied. The latter is the reason I haven't been able to really make sense of it.
 
hi there...

that sound's funny. I'm working on SuSE 9.1 with Plesk 7.5.2 and it work's problem-less ;)

Many of our sites (PHP coded pages) use the extension .html for seach engines like google, and also in webstat directory we need the php functions for our special scripts.

If I have any idea how to solve this, i'll post it here.


kind regards from Austria
manuel
 
I'm having the exact same problem on my server; the only problem is several of the sites we host use PHP in a number of .html documents, and I don't exactly have the option of converting everything to .php.

I didn't really understand alfmanuel's suggestion... any more ideas? Hopefully this'll get bumped so someone will see it again...
 
hi there.

mhm so the line is in your .htaccess file ?

if that's all correct you have to tell apache that htaccess is allowed to configure this feature... ;)

kind regards from austria
manuel
 
Back
Top