[eluser]Unknown[/eluser]
[quote author="Johnny Freeman" date="1308016990"]Hey Saxywolf,
the only thing I've noticed in your code that could be a problem is that you are extending MY_Controller instead of CI_Controller, but should not be the cause of a HTTP 500 ERROR. In my experience, .htaccess is usually (part of) the problem so I'd backup and delete the .htaccess and see if that helps.
Another thing I just noticed was that you're using a closing php tag. It's generally a bad idea to use a closing php tag in your controllers, models, libraries, and helpers because you run the risk of allowing whitespace to creep in before the output buffer has been sent to the browser. Let me clarify: It is totally possible to use closing php tags without issue. However, why introduce another point of possible failure, especially when it's not necessary?
Copy and paste this into your homepage controller and let us know what happens:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// check if this file was found
log_message('debug','loaded ../application/controllers/homepage.php');
class Homepage extends CI_Controller {
public function __construct()
{
parent::__construct();
// check if this controller has been instantiated
log_message('debug','Homepage class instantiated');
}
public function index()
{
$this->load->view('welcome_message');
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
[/quote]
.../application/core/My_Controller.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
log_message('debug','loaded .../application/core/My_Controller.php');
function __construct()
{
parent::__construct();
}
}
The only .htaccess file is in the .../application/ folder, but renaming it doesn't do anything.
Simply replacing the Homepage.php code then yielded:
Quote:ERROR - 2011-06-14 23:25:58 --> Severity: Notice --> Undefined property: CI_Loader::$ion_auth .../application/views/welcome_message.php 8
So, I added
Code:
$this->load->library('ion_auth');
$this->load->helper('url');
and I got an execution time message in the log!
But I can't add:
Code:
$this->load->view('template', $page);
as it will yield:
Quote:ERROR - 2011-06-14 23:59:50 --> Severity: Notice --> Undefined variable: page .../application/controllers/homepage.php 21
ERROR - 2011-06-14 23:59:50 --> Severity: Notice --> Undefined variable: content .../application/views/template.php 58
So... is there something wrong with MY_Controller?
The real troubling part is that the code I had is from a buddy whose mac it works on just fine.