• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

can't parse php in .html files

S

skepticwebguy

Guest
I've recently moved from a MediaTemple (dv) 3.5 to a (dv) 4.0. I am now running Plesk 10.4.4.

When I configure PHP Settings to "run as FastCGI application" rather than as an "Apache module" my server will not parse php within html files. Viewing source of the blank page reveals the unparsed php. No errors occur in the log.

Setting PHP to run as an Apache module will parse php in html files as long as I have this line in my .htaccess file:

AddHandler php5-script .php .html


I've tried adding the following groups of lines (at various times) to my .htaccess file, but php still won't parse in FastCGI mode:

AddType x-httpd-php .php .htm .htm

addtype application/x-httpd-php .html

<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php
</FilesMatch>

AddType application/x-httpd-php php html

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

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

I have NOT tried modifying apache.httpd.conf yet.

Suggestions?
 
Did you try

/usr/local/psa/admin/sbin/httpdmng with options --reconfigure-all or --reconfigure-server ?
 
Did you try

/usr/local/psa/admin/sbin/httpdmng with options --reconfigure-all or --reconfigure-server ?

I haven't tried either of those commands.

What does --reconfigure-all do exactly? I don't want to mess up the other domains that are working (that don't have php in html files). I could change all the html files to php extensions, but I'd have a mess of redirects and dead site links if I did that. Google would not be happy with all the old dead links to .html files.

What about --reconfigure-domain <domain.com> ? At least that wouldn't affect the other domains on the server.
 
I changed php settings to 'fastcgi application' from 'apache module' and saved.

I ran:

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
/etc/init.d/httpd restart

No change. php on .html pages still won't parse with this line in my .htaccess file:

AddHandler php5-script .php .htm .html .inc
 
What about parsing without your custom .htaccess file?
 
Simply adding this line to my .htaccess file did the trick:

AddHandler php-script .html
 
Now, I need a solution to parse php in .inc files as well. And this doesn't work:

AddHandler php-script .inc
 
hi

i have tried all things in this post... still can,t get parse php in html file..

I am using Amazon.com hosting.. Please find me a problem..

Thanks..
 
Back
Top