• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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