Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Class 'Public_Controller' not found in...
#1

[eluser]swgj19[/eluser]
Ok, I am assisting in building a blog with another developer. Basically we are improving the Wrox blog tutorial into a full fledged blog.

We decided to extend the MY_Controller to Admin_Controller and Public_Controller. To separate the public from the admin.

These files our in the core directory.

The other developer Ray uploaded the same files to his server with similar .htaccess file (except for php sever version) and I am getting this error and he is not. I called the hosting Hostgator.com and they said it is a coding issue. I even checked to see how filezilla changes capitalized files to lowercase when uploaded. Any suggestions to solve this error. The code works perfect on my local server. Obviously it cannot be a coding issue.

Here is my .htaccess file:

Code:
DirectoryIndex index.php

Options +FollowSymLinks

    RewriteEngine On
    RewriteBase /


# Use PHP 5.3
AddType application/x-httpd-php53 .php

#Action application/x-hg-php53 /cgi-sys/php53
#AddHandler application/x-hg-php53 .php

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

    RewriteCond $1 !^(index\.php|assets|editor|css|js|scripts|images|img|media|xml|robots\.txt|favicon\.ico)
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

I checked my native php function in my blog.php

Code:
/*
| -------------------------------------------------------------------
|  Native Autoload - by Phil Sturgeon. New Version!
| -------------------------------------------------------------------
|
| Nothing to do with config/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
| If using HMVC you do not need this! HMVC will spl_autoload.
|
| Place this code at the bottom of your application/config/config.php file.
*/
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        if (file_exists($file = APPPATH . 'core/' . $class . EXT))
        {
            include $file;
        }
        elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT))
        {
            include $file;
        }
    }
}

This is MY_Controller.php

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
* Created by PhpDesigner7.
* User: Ray King
* Date: 1/9/2012
* Time: 2:25:59 PM
* The IgnitedCoder Development Team.
* To change this template use File | Settings | File Templates.
*/

class Base_Controller extends CI_Controller {

/**
  * Class variables - public, private, protected and static.
  */


  // ----------------------------------------------------------------------

/**
  *  __construct
  *
  * Class Constructor PHP 5+
  *
  * @access public
  * @return void
  */
  public function __construct()
  {
   parent::__construct();

  // Company settings
  $data['copyright']  = $this->config->item('company_name');
  $data['blog_version'] = $this->config->item('blog_version');
  $data['company_email'] = $this->config->item('company_email');

  // Page title settings
  $data['dash_title']  = $this->config->item('dash_title');
  $data['page_title']  = $this->config->item('page_title');

  $this->load->vars($data);
}

  // ----------------------------------------------------------------------

/**
  * Index Page for this controller.
  *
  */
public function index()
{

}

}

// ------------------------------------------------------------------------
/* End of file Base_Controller.php */
/* Location: ./application/core/MY_Controller.php */




Theme © iAndrew 2016 - Forum software by © MyBB