http://www.kancloud.cn/manual/thinkphp/1717
如果在Linux環境下面,一旦大小寫不一致,就會發生URL裡面使用小寫模組名不能找到模組類的情況。例如在Linux環境下面,我們訪問 http://serverName/index.php/home/index/index 其實請求的控制器檔案是
Application/home/Controller/indexController.class.php
如果在Linux環境下面, 什麼意思?
什麼“在Linux環境下面”?
什麼東西“在Linux環境下面”?
回複內容:
http://www.kancloud.cn/manual/thinkphp/1717
如果在Linux環境下面,一旦大小寫不一致,就會發生URL裡面使用小寫模組名不能找到模組類的情況。例如在Linux環境下面,我們訪問 http://serverName/index.php/home/index/index 其實請求的控制器檔案是
Application/home/Controller/indexController.class.php
如果在Linux環境下面, 什麼意思?
什麼“在Linux環境下面”?
什麼東西“在Linux環境下面”?
Linux
環境下檔案區分大小寫,既indexController.class.php
和IndexController.class.php
不是同一個檔案,而如果使用http://serverName/index.php/home/index/index
進行訪問,而控制器命名為IndexController.class.php
,就會出現找不到控制器的情況,因為這種情況下控制器檔案名稱被解析成了indexController.class.php
。
通過設定URL_CASE_INSENSITIVE
為true
,可讓ThinkPHP
自動轉換index
為Index
,達到正常識別檔案的效果。
Linux作業系統下,要區分大小寫,
windows作業系統下,不用區分大小寫
開發的系統格式linux作業系統,你的PHP開發環境應按照在linux作業系統下