• 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

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