Welcome Guest, Not a member yet? Register   Sign In
Problem with 'Hello World'
#1

[eluser]ammtar[/eluser]
This is my first contact with framework. with CI too, of course.
I downloaded CI, unpacked in MAMP, started first tutorial, "Hello World" - and got white screen!?!?!?!? No error but the screen, view source as well, is empty.

Not so promising beginning :-(

1. unpacked zip and renamed to ci
2. moved ci to htdocs (MAMP)
3. in "controllers" created file "site.php", as said in tutorial
4.
Code:
class Site extends Controller
{
    function index()
    {
       echo "Hello World";
    }
}

5. open browser: localhost/ci
I'm getting "Welcome to CodeIgniter" message

6. opening localhost/ci/index.php/site/index, as it said in tutorial, and - nothing. Empty page. View source is empty too.

If my version of CI and version of CI used in the video tutorial are not "compatible" where to find correct on? What I supposed to do before?

Thanks for any help.

Afan
#2

[eluser]Mirge[/eluser]
Turn on error reporting, or view your error log
#3

[eluser]tomcode[/eluser]
Since CI 2.0, You need to extend CI_Controller instead of Controller

Code:
class Site extends CI_Controller
{
    function index()
    {
       echo "Hello World";
    }
}

edit: Use the user guide bundled with the distribution, a lot of tutorials available still refer to CI 1.* versions, CI 2.* has some fundamental changes
#4

[eluser]danmontgomery[/eluser]
or use http://ellislab.com/codeigniter/user-guide/toc.html, which is up to date.
#5

[eluser]ammtar[/eluser]
[quote author="tomcode" date="1312405070"]Since CI 2.0, You need to extend CI_Controller instead of Controller

Code:
class Site extends CI_Controller
{
    function index()
    {
       echo "Hello World";
    }
}

edit: Use the user guide bundled with the distribution, a lot of tutorials available still refer to CI 1.* versions, CI 2.* has some fundamental changes[/quote]

yup... that's it...

thanks.




Theme © iAndrew 2016 - Forum software by © MyBB