我通過Code Igniter創建了一個應用程序,並且在xampp中一切正常。但是,當我啓動它在我的網絡服務器(Hawkhost),我得到這個錯誤:CI:上傳到網絡主機時未找到My_Controller
Fatal error: Class 'MY_controller' not found in /home/deremoec/public_html/an.deremoe/application/controllers/search.php on line 5
我已經改名爲從虛擬主機提供商的BASE_URL我的域名。
我也將我的.htaccess重命名爲當前的webserver文件夾。
對於一個清醒的認識
$config['base_url'] = 'http://an.deremoe.com/';
我的.htaccess
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/, use/
# If your URL is www.example.com/site_folder/, use /site_folder/
RewriteBase /an.deremoe/
# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For reuests that are not actual files or directories,
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
你檢查過該案件嗎? – zourite 2012-07-06 13:58:06
My_controller類的php文件是MY_controller.php。我應該將其更改爲my_controller.php嗎? @zourite – 2012-07-06 14:01:10
你的班級的名字與文件名相同是什麼?是的,嘗試小寫 – zourite 2012-07-06 14:04:16