Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7488623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:00:06+00:00 2026-05-29T15:00:06+00:00

I am hosting a CodeIgniter site locally using MAMP on my mac. Whenever I

  • 0

I am hosting a CodeIgniter site locally using MAMP on my mac.

Whenever I try to load a model the site runs an HTTP 500 error and I’m not sure what is going one. I suspect I’ve overlooked something very minor but I’m just not seeing it.

Controller: main.php

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

 class Main extends CI_Controller {

public function index()
{
    //load content model
    $this->load->model('content_model');

    //grab content from the database
    //$data['content'] = $this->content_model->get_content(0);

    //display content
    $this->load->view('main_view');
}
 }
 ?>

Model: content_model.php

 <?php 
 class Content_model extends CI_Model {

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

public function get_content($navID)
{
    $this->db->limit(1);
    $this->db->where('navID', $navID);
    $query = $this->db->get('pmlSiteContent');
    return $query->result();
}
 ?>

autoload.php

 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 $autoload['packages'] = array();
 $autoload['libraries'] = array('database', 'session');
 $autoload['helper'] = array('url', 'form', 'file');
 $autoload['config'] = array();
 $autoload['language'] = array();
 $autoload['model'] = array();
 ?>

database.php

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

 $active_group = 'default';
 $active_record = TRUE;

 $db['default']['hostname'] = 'localhost:8889';
 $db['default']['username'] = 'root';
 $db['default']['password'] = 'root';
 $db['default']['database'] = 'pmlcms';
 $db['default']['dbdriver'] = 'mysql';
 $db['default']['dbprefix'] = '';
 $db['default']['pconnect'] = TRUE;
 $db['default']['db_debug'] = TRUE;
 $db['default']['cache_on'] = FALSE;
 $db['default']['cachedir'] = '';
 $db['default']['char_set'] = 'utf8';
 $db['default']['dbcollat'] = 'utf8_general_ci';
 $db['default']['swap_pre'] = '';
 $db['default']['autoinit'] = TRUE;
 $db['default']['stricton'] = FALSE;
 ?>

What am I missing? Help is greatly appreciated, thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:00:07+00:00Added an answer on May 29, 2026 at 3:00 pm

    The error is in content_model.php
    you missed the end bracket of the class. It’s a bad idea to use the end php tags

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am hosting multiple sites on the same server and using a http-vhosts file
I am using Coda to create a web application using CodeIgniter. I am hosting
I have a shared hosting account, and I just started using source control locally
I am using PHP and the codeigniter framework for a project I am working
My hosting plan allows me to host multiple sites. When I try to add
I have developed numerous websites using Codeigniter, but now have the need to migrate
My hosting company is now saying that their (8)Exec format error: exec of '/home/
Im hosting a rails app on heroku. It runs on the client on a
I'm hosting my code on Bitbucket using Git. My local client is EGit (eclipse
My hosting has multiple deployments of my site (dev, stage, production). How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.