CodeIgniterのファイル名はCase-Sensitive

久々にCodeIgniterでハマったのでメモ。

ローカルのWindowsで開発していたアプリを運用のためにLinuxのサーバにアップしたところ、訳のわからないところでエラーが出てまったく動かない。潜ってみると、原因はあるコンフィグファイルが大文字小文字の違いで正しくincludeされていなかったためだった。

たとえば自作ライブラリのクラス名を
CustomParser
とした場合、そのライブラリのファイル名は
application/libraries/CustomParser.php
コンフィグファイルを使うならそのコンフィグファイル名は
application/config/CustomParser.php
と、大文字小文字を完全に一致させる必要がある。

なおWindows環境ではファイル名はcase-sensitiveではないようなので、幸か不幸か問題なく動いてくれる。

Categories: HowTo's, Tips and Tricks | Tagged , , | Trackback URL |

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>