LoginSignup
0
0

More than 5 years have passed since last update.

SSIを使用していないはずなのに[an error occurred while processing this directive]のエラーが出る

Last updated at Posted at 2018-03-20

はじめに

MAMP、XAMPPとかでSSI有効にしている開発環境だと、起こりやすい気がしたのでメモです。
こんなのが最初の投稿になってしまいました。

現象

タイトルの通りです。
HTML上では、SSIを使用していないはずなのに、
[an error occurred while processing this directive]のエラーが出てしまいました。

HTMLコーディングを引き継いだ時に、起こった現象です。
作業環境の違いで起きてしまいました。

詳細

[an error occurred while processing this directive]

調べて見たところ、これはSSIのエラーらしい。

コードを見たら、下記のコメントが書かれていた。

<!--#mainContents-->

どうやら、「<!--#」の書き出しだとSSIのソースになるらしい。

ということで、下記のようにスペースを入れてあげたところ、エラーが出なくなった。

<!-- #mainContents -->

備考

SSI無効の環境だと、もちろんエラーが出ない(コメントとして見なされる)ので、
SSI無効→SSI有効の環境に移行した時に起きやすいかもしれない。

まとめ

HTMLのコメントは、前後にスペースを空けて書こう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0