ユーザ用ツール

サイト用ツール

Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/8/8a1ed44f8d8500d2dd9ee7ee664af81d.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/8/8a1ed44f8d8500d2dd9ee7ee664af81d.metadata failed

htaccessの設定でutf-8表示
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/8/8a1ed44f8d8500d2dd9ee7ee664af81d.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/8/8a1ed44f8d8500d2dd9ee7ee664af81d.xhtml failed

.htaccessの設定 (アクセス制限と許可)

*UTF-8 で作成・保存して UTF-8 で表示させる場合

# PHP5
 <IfModule mod_php5.c>
  php_flag  output_buffering              Off
  php_value output_handler                none
  php_value default_charset               UTF-8
  php_value mbstring.language             Japanese
  php_flag  mbstring.encoding_translation On
  php_value mbstring.http_input           auto
  php_value mbstring.http_output          UTF-8
  php_value mbstring.internal_encoding    UTF-8
  php_value mbstring.substitute_character none
 </IfModule>

# PHP4
 <IfModule mod_php4.c>
  php_flag  output_buffering              Off
  php_value output_handler                none
  php_value default_charset               UTF-8
  php_value mbstring.language             Japanese
  php_flag  mbstring.encoding_translation On
  php_value mbstring.http_input           auto
  php_value mbstring.http_output          UTF-8
  php_value mbstring.internal_encoding    UTF-8
  php_value mbstring.substitute_character none
 </IfModule>

*UTF-8 で作成・保存して Shift_JIS で表示させる場合

# PHP5
 <IfModule mod_php5.c>
  php_flag  output_buffering              On
  php_value output_handler                mb_output_handler
  php_value default_charset               Shift_JIS
  php_value mbstring.language             Japanese
  php_flag  mbstring.encoding_translation On
  php_value mbstring.http_input           auto
  php_value mbstring.http_output          SJIS
  php_value mbstring.internal_encoding    UTF-8
  php_value mbstring.substitute_character none
 </IfModule>

# PHP4
 <IfModule mod_php4.c>
  php_flag  output_buffering              On
  php_value output_handler                mb_output_handler
  php_value default_charset               Shift_JIS
  php_value mbstring.language             Japanese
  php_flag  mbstring.encoding_translation On
  php_value mbstring.http_input           auto
  php_value mbstring.http_output          SJIS
  php_value mbstring.internal_encoding    UTF-8
  php_value mbstring.substitute_character none
 </IfModule>

実際phpで文字エンコーディングの自動変換をしてしまうとトラブルの原因になりかねないようなので、

  php_flag  mbstring.encoding_translation Off
  php_value mbstring.http_input           pass
  php_value mbstring.http_output          pass

と、変換を無効にしてやった方が無難かも知れません。特にたまに文字化けが起きるなんて方はもう一度mbstring関連の設定を見直した方が良いでしょう。

htaccessの設定でutf-8表示.txt · 最終更新: 2013/11/27 12:41 by luis_lee