Welcome Guest, Not a member yet? Register   Sign In
Controller not recognized
#1

[eluser]Kraig[/eluser]
I am using MAMP on my iMac OS X 10.7.3. I have installed code igniter to the htdocs of my server, and when I go to 'http://localhost:8888/ci/index.php/' I get the Welcome to CodeIniter screen. Meaning that it is working and setup for my server. Now I am following along with one of the tutorial videos and here's my sample controller..

controllers/site.php
Code:
<?php

class Site extends Controller {

function index() {
  echo 'Test';
}
}

?> // I have tried this with ?> and without ?>

I run this by typing http://localhost:8888/ci/index.php/site/ in the browser, and I get:

Server error
The website encountered an error while retrieving http://localhost:8888/ci/index.php/site/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

However if I do http://localhost:8888/ci/index.php, everything works fine. Any ideas?

Thank you in advance!!
#2

[eluser]CroNiX[/eluser]
What version of CI are you using? The way you created the class is for versions before version 2.
#3

[eluser]Kraig[/eluser]
I'm using the newest version.
#4

[eluser]CroNiX[/eluser]
Check the user guide on creating a controller.




Theme © iAndrew 2016 - Forum software by © MyBB