PHPでgettextする際の注意事項というか、setlocaleの罠 - tohokuaikiのチラシの裏

罠3 Apacheを再起動せよ
検索したらPHPドキュメントのコメントが・・・。 PHP: setlocale - Manual

Omer Sabic
On Linux/Apache, when you install and try to use a new locale, the setlocale() function with the new locale will fail sometimes, but not always. To furthermore complicate, setlocale() will always complete with any of the previously installed locales. This would seem a really weird behaviour, which you can fix by restarting Apache, as Kari Sderholm aka Haprog mentioned, but I felt it needed to be properly pointed out.

Apacheを再起動せよと・・・・。 確かに治った。

なるほど。そしてリリース手順に「services httpd graceful」を組み込んだら、ロケールの設定に失敗することがなくなりました。おおー。これまでモヤモヤしてたのが解決してスッキリしてよかったけど、でもまじかー。こんな簡単なことだったのか。
  • About

    I'm a web designer/programmer in Kyoto, Japan. Also work as a blogger, DJ.

    NOBODY:PLACE is my personal blog since 1998. Everything I'm interested in is here.

    See Also
    Other Works
  • Recent Hatena Bookmark
  • Monthly Archives