使用codeigniter出現404有關問題
最後更新:2016-06-13
來源:互聯網
上載者:User
使用codeigniter出現404問題
各位好,初使用codeigniter出現了如下問題:
1、windows xp下運行正常,linux下運行出現404錯誤。
2、訪問首頁可以顯示(http://ip地址/項目名/或http://ip地址/項目名/index.php/index),但是點登入時(http://ip地址/項目名/index/login)出現404錯誤,index控制器中是存在public的login方法。
3、linux環境為red hat 企業版5 ,apache為2.0.64,php為5.4.3 apache配置了rewrite也 加了path info
嘗試過修改config.php中的uri_request 為各個可能的值(query_string,auto等)現象依舊。
看codeigniter的日誌似乎login.php已經發送到瀏覽器了,但是為什麼還是404呢
同樣的程式在windows下沒有問題,請問大家問題可能出在哪裡呢?謝謝!
附codeigniter日誌:
DEBUG - 2012-06-01 09:42:54 --> Config Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Hooks Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Utf8 Class Initialized
DEBUG - 2012-06-01 09:42:54 --> UTF-8 Support Enabled
DEBUG - 2012-06-01 09:42:54 --> URI Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Router Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Output Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Security Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Input Class Initialized
DEBUG - 2012-06-01 09:42:54 --> XSS Filtering completed
DEBUG - 2012-06-01 09:42:54 --> Global POST and COOKIE data sanitized
DEBUG - 2012-06-01 09:42:54 --> Language Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Loader Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Controller Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Helper loaded: form_helper
DEBUG - 2012-06-01 09:42:54 --> Form Validation Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Session Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Helper loaded: string_helper
DEBUG - 2012-06-01 09:42:54 --> Encrypt Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Database Driver Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Session routines successfully run
DEBUG - 2012-06-01 09:42:54 --> DX Auth Initialized
DEBUG - 2012-06-01 09:42:54 --> Session class already loaded. Second attempt ignored.
DEBUG - 2012-06-01 09:42:54 --> Config file loaded: application/config/dx_auth.php
DEBUG - 2012-06-01 09:42:54 --> Language file loaded: language/japanese/dx_auth_lang.php
DEBUG - 2012-06-01 09:42:54 --> Model Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Model Class Initialized
DEBUG - 2012-06-01 09:42:54 --> Model Class Initialized
DEBUG - 2012-06-01 09:42:54 --> utilityies class already loaded. Second attempt ignored.
DEBUG - 2012-06-01 09:42:54 --> Helper loaded: url_helper
DEBUG - 2012-06-01 09:42:54 --> Config file loaded: application/config/access_limit.php
ERROR - 2012-06-01 09:42:54 --> Severity: Notice --> Undefined variable: message /usr/local/apache2/htdocs/tab/application/views/login.php 44
DEBUG - 2012-06-01 09:42:54 --> File loaded: application/views/login.php
DEBUG - 2012-06-01 09:42:54 --> Final output sent to browser
DEBUG - 2012-06-01 09:42:54 --> Total execution time: 0.0547
------解決方案--------------------
先嘗試一下這樣是否可以
http://ip地址/項目名/index.php/index/login
http://ip地址/項目名/index.php/login