Я разработал свой сайт на XAMPP на компьютере Win 7, и он отлично работает на localhost. Когда я загрузил его на живой сервер (linux). Он начал показывать мне эту ошибку:Codeigniter /application/core/Frontend_Controller.php не найден на реальном сервере
Fatal error: Class 'Frontend_Controller' not found in /home/acephm3/public_html/phenomesoft.com/application/controllers/Home.php on line 3
Я проверил и применил все, что мог от Google, но не повезло вообще.
Я использую версию 3.0 CI.
Я поставил $config['subclass_prefix'] = 'MY_';
Created My_Controller.php
следующим образом в /application/core
:
class My_Controller extends CI_Controller {
public function __construct() {
parent::__construct();
// Your own constructor code
}
public function send_mail($from, $from_name, $to, $subject, $message, $smtp, $debug) {
$this->load->library('email');
if (!$smtp) {
$this->email->from($from, $from_name);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($message);
if ($this->email->send()) {
$this->session->set_flashdata('message', 'We\'ve received your message. Thank you for contacting us.');
redirect('contact_us');
} else {
if ($debug) {
echo $this->email->print_debugger();
}
return false;
}
}
}
}
В комплекте:
include_once('Frontend_Controller.php');
Создано Frontend_Controller.php
в /application/core/
следующим образом:
class Frontend_Controller extends My_Controller {
public $data;
public function __construct()
{
parent::__construct();
// Your own constructor code
$this->data = array();
}
public function _load_template($tpl, $data)
{
$this->load->view('frontend/includes/header', $data);
$this->load->view('frontend/'.$tpl, $data);
$this->load->view('frontend/includes/footer', $data);
}
}
Создан контроллер Home.php
под apllication/controllers/
:
class Home extends Frontend_Controller {
public function __construct() {
parent::__construct();
// Your own constructor code
}
public function index(){
$this->_load_template('home', $this->data);
}
}
$route['default_controller'] = 'home';
Установить в routes.php.
Что мне еще нужно делать? Обратите внимание, что у меня нет проблем с localhost.
Надеюсь, эта ссылка поможет: http://stackoverflow.com/questions/4845806/codeigniter-2-0-fatal-error-class-controller-not-found-in –
Нет, это не мой случай .. Спасибо за помощь. – Ali