Reputation: 2353
I'm really new to CodeIgniter and am having some trouble getting started. I see a lot of articles addressing the 500 Internal Server Error that I'm getting, but ALL of the authors of these articles seem to at least have gotten farther than I am able to.
So here's the situation. I have MAMP running correctly on my Mac. I downloaded CodeIgniter from their website (twice, actually) for a fresh start and extracted it in the correct MAMP folder. If I go to the index page, it works:
http://localhost:8888/index.php
But that's the only page that doesn't give me a 500 error. I create a really simple controller from CodeIgniter's video tutorial and save it in application/controllers.
<?php
class Blog extends Controller {
function index()
{
echo 'Hello World';
}
}
?>
Then I try to access it and get the 500 error:
http://localhost:8888/index.php/blog/
I tried several other tutorials as well, but I always get the error. What am I doing wrong? I tried several .htaccess variations suggested in other posts; right now I just have the default which only includes Deny from all
, which shouldn't be pretty but should at least work. I also tried modifying the config.php file, setting $config['base_url']
and moving around the files as well as trying every variation of $config['uri_protocol']
as suggested in another post, all to no avail.
What am I doing wrong? Kind of disheartening having such a progress-stopping problem right of the bat.
Upvotes: 0
Views: 2495
Reputation: 832
I have faced same issue and solved by giving permission to all the folders
Upvotes: 0
Reputation: 19284
First of all, i think the video you are watching is out of date because with CI 2, your code should look like this:
<?php
class Blog extends CI_Controller {
function index()
{
echo 'Hello World';
}
}
?>
Also, since you're just getting started, ditch the .htaccess file and call your app using the url with index.php in it, as you're doing.
In your case, the url should be http://example.com/index.php/blog/index
.
If that still doesn't work, post your base_url config variable from config.php and also your routes.php file.
Upvotes: 1