Reputation: 89
I'm trying to go through Hello World tutorial to the CodeIgniter, but cannot get the appropriate result. I'm running on Ubuntu 10.10 and apache2. I suspect, there's something wrong with permissions, but don't know how to fix that. What I've done:
sudo chmod 777 /var/www
.<?php class Blog extends Controller { function index () { echo "Hello World";} } ?>
And instead of having "Hello World" http://localhost/ci/index.php/blog/index/ takes me to completely blank page and http://localhost/ci/blog/index/ to Apache's 404 not found! BTW, "http://localhost/ci/indeex.php/blog/indeex/" takes me to the blank page too, but "http://localhost/ci/index.php/bloog/indeex/" - to the CI's 404 page. As you can guess, I'm completely newe to that stuff and would be really glad if you help me. There are few quite similar questions here, but none of them helps.
Upvotes: 0
Views: 1282
Reputation: 25445
<?php class Blog extends Controller { function index () { echo "Hello World";} } ?>
Is a code for older version of CI (1.7?).
What version are you running? if > 2 (likely; if you dowloaded the present one, its 2.1.0), you should use (note the parent class name):
file controllers/blog.php
:
<?php
class Blog extends CI_Controller
{
function index()
{
echo "Hello World";
}
}
?>
Upvotes: 1