• 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 SSI .shtml files not working as expected on new server

PHPBandit

New Pleskian
I recently moved from an old VPS wth Plesk 12.0.18 on CentOS 5 to a new VPS with Plesk 17.0.17 with CentOS 7. I am having a problem where PHP is being displayed in the .shtml files on the new server even though they were working properly on the new server.

For example, I have the exact same file on both servers in question, say test.shtml. They each have the same code. On the old server, the actual inclusion of PHP code is not output when viewing the page source in a browser. On the new server, with the same code, the PHP code is output in the page source. Site on new server uses PHP 5.4, the default version, and old server uses PHP 5.3. On old server, it is run with FCGI or CGI, new server it is with FPM over Apache.

I have tried various fixes with: plesk repair all, plesk repair web, editing the .htaccess, disabling and re-enabling SSI, but nothing has worked.

On the new server, this is the portion of httpd.conf:

<IfModule mime_module>
# other stuff before this
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>

On old server, that same code is in httpd.conf but not in the <IfModule>

I have tried variotions of the following in htaccess

Code:
AddType text/html .shtml
AddHandler server-parsed .shtml
 Make PHP parse SHTML files
AddHandler application/x-httpd-php .shtml
AddHandler php-script .shtml
AddType text/html .shtml
AddType application/x-httpd-php .shtml

Edit: Fixed by adding following to htaccess

Code:
<Files ~ (\.shtml)>
   SetHandler None
   AddHandler php-script .shtml
   Options +ExecCGI
   allow from all
</Files>
 
Last edited:
Back
Top