2013-01-16 91 views
0

你好,大家好我嘗試在笨1.7.1工作我已經做一步步驟安裝 的頁面,但其顯示的錯誤 404找不到網頁 頁面你所要求的沒有被發現。404找不到頁面您請求沒有found.-笨

這裏是碼我用

控制器home.php

class Home extends Controller { 
     function __construct() 
     { 
     parent:: __construct(); 
     //$this->output->enable_profiler(); 
     $this->load->library('DX_Auth'); 

    } 

模型homemodel.php

class HomeModel extends Model { 


    function __construct() 
    { 
     // Call the Model constructor 
     parent::Model(); 

    } 

的.htaccess

RewriteCond $1 !^(index\.php|assets|xcache|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 

我使用本地主機 「XAMPP」

請幫我

和主要的index.php

<?php 

    error_reporting(E_ALL); 

    $system_folder = "system"; 


    $application_folder = "application"; 


if (strpos($system_folder, '/') === FALSE) 
{ 
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE) 
    { 
     $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder; 
    } 
} 
else 
{ 
    // Swap directory separators to Unix style for consistency 
    $system_folder = str_replace("\\", "/", $system_folder); 
} 


define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); 
define('FCPATH', __FILE__); 
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); 
define('BASEPATH', $system_folder.'/'); 

if (is_dir($application_folder)) 
{ 
    define('APPPATH', $application_folder.'/'); 
} 
else 
{ 
    if ($application_folder == '') 
    { 
     $application_folder = 'application'; 
    } 

    define('APPPATH', BASEPATH.$application_folder.'/'); 
} 

/* 
|--------------------------------------------------------------- 
| LOAD THE FRONT CONTROLLER 
|--------------------------------------------------------------- 
| 
| And away we go... 
| 
*/ 
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; 

/* End of file index.php */ 
/* Location: ./index.php */ 

服務器錯誤致命錯誤:類 '內存緩存' 中找不到/ 21線上的hermes/bosoraweb075/b2180/ipg.djsaifnycom/paly/system/application/controllers/home.php

function index() 
{ 
    $data['memcache'] = new Memcache; 
    $data['memcache']->pconnect('localhost', 11211) or $memcache = false; 
    //$this->output->cache(60); 
    $this->load->model('dx_auth/UserModel', 'user'); 
    $this->load->model('homemodel'); 
    $data['title'] = "Home"; 

    if($this->dx_auth->is_logged_in()) 
    { 
     $query = $this->user->get_user_by_id($this->session->userdata('DX_user_id')); 
     //now we get personalized 

     $row = $query->row(); 
     $data['feedFilter'] = $row->feed_filter; 
     $data['feedView'] = $row->feed_view; 
     if($data['feedFilter'] == 'tagged') 
     { 
      $data['feedList'] = null; 
      $data['feedList'] = $data['memcache']->get('feed' . $data['feedFilter'] . $row->feed_view); 
      if($data['feedList'] == null) 
      {   
       $data['albums'] = $this->homemodel->getTagged(); 
      } 
     } else { 
      $data['feedList'] = null; 
      $data['feedList'] = $data['memcache']->get('feed' . $data['feedFilter'] . $row->feed_view); 
      if($data['feedList'] == null) 
      { 
       $data['albums'] = $this->homemodel->getFeedNoUser(); 
      } 
     } 
     //$this->output->enable_profiler(); 
     $this->template->write('title', 'Home'); 
     $this->template->write_view('content', 'home/index', $data, TRUE); 
     $this->template->render(); 


    } else { 
     $data['feedFilter'] = 'all'; 
     $this->load->helper('cookie'); 
     if(get_cookie('unravel_feedView')) 
     { 
      $data['feedView'] = 0; 
     } else { 
      $data['feedView'] = 1; 
     } 

     //this would be generic feed here 
     $data['feedList'] = null; 
     $data['feedList'] = $data['memcache']->get('feed' . $data['feedFilter'] . $data['feedView']); 
     if($data['feedList'] == null) 
     { 
      $data['albums'] = $this->homemodel->getFeedNoUser(); 
     } 
     $this->template->write('title', 'Home'); 
     $this->template->write_view('content', 'home/index', $data, TRUE); 
     $this->template->render(); 
    } 



    //$this->load->view('home/index', $data); 
    //$this->output->enable_profiler(TRUE); 
} 

線路 $數據[ '內存緩存'] =新內存緩存;

+1

你在訪問什麼URL,也是你的根web文件夾中的index.php? –

+0

我使用localhost/cashmusic – Saif

+0

當'CI 2.1.3'發佈'2012年10月8日'可用時,您是否有使用'CI 1.7.1'發佈'2009年2月10日'的原因?如果您現在正在製作此應用程序,則應使用最新版本的CI開發它。很難在這樣的舊版本上提供支持。 –

回答

0

也許.htaccess不在正確的目錄..你可能想要檢查它,應該在你的項目目錄。如果是這樣,

把這個在您的.htaccess文件

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 
+0

是它在正確的目錄localhost/cashmusic/.htaccess沒有老闆仍然是相同的錯誤 – Saif

+0

好老闆我安裝在我的網絡服務器,但它給我這個「致命錯誤:類'Memcache'找不到.../../.../paly/system/application/controllers/home.php在第21行我將代碼放在頂部 – Saif

+0

也許你需要啓用重寫模塊.. a2enmod rewrite 然後重新啓動你的apache服務器 你還需要安裝memcache sudo apt-get install php5-memcache – jesanjose

0

你可能還需要檢查你的httpd.conf文件,看看是否Apache是​​允許「榮譽」 .htaccess文件。搜索AllowOverride命令並將其從AllowOverride None(默認值)更改爲AllowOverride All

ALSO:之後不要忘記重啓httpd服務器。

+0

我沒有工作 – Saif