CodeIgniter Forums
Tutorial Issue? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Tutorial Issue? (/showthread.php?tid=61562)



Tutorial Issue? - qkzoo - 04-26-2015

Hi.  I setup a raspberry pi as a test server running nginx, php and mysql.  I downloaded codeigniter and installed it to my web root, and started running through the CI tutorial, as I'm new to MVC.

Everything seemed to be running smooth, I got through the first steps in the http://www.codeigniter.com/user_guide/tutorial/static_pages.html page, and then ran into a problem at the beginning of the "Routing" section:

Quote:The controller is now functioning! Point your browser to [your-site-url]index.php/pages/view to see your page. When you visit index.php/pages/view/about you’ll see the about page, again including the header and footer.

If I point my browser to index.php/pages/view I get a 404.  If I visit index.php/pages/view/about I get a 404.  Something, a step perhaps, seems to be missing?


RE: Tutorial Issue? - n2fole00 - 04-27-2015

Hi, I'm also new at this, but from my understanding, the page in [your-site-url]index.php/pages/view would have to be an index.php for you to skip the declaration of the page (the argument of the view method). (The index of the view is currently the 404 page).
The tutorial seems to specify it's home.php (in the controller), so you have to do something like [your-site-url]index.php/pages/view/home and make sure there is a home.php in the view folder.

I quickly tested with this...

PHP Code:
   public function view($page 'home')
   {
    
   $this->load->view('test/'$page); // I put home.php in a folder called test
   

...and it seemed to work.


RE: Tutorial Issue? - qkzoo - 04-27-2015

Yes, I realize that.  There is a home.php, as it told me to create a home.php and an about.php in the tutorial.  Unfortunately, the routing just doesn't seem to work.  Am I supposed to do something specific to get the index.php/ url thing to work properly?

EDIT:

Further digging and even http://192.168.1.2/index.php/welcome doesn't work, which is the built in sample. If this url isn't working, something has got to be off.


RE: Tutorial Issue? - n2fole00 - 04-27-2015

What server are you using? The easiest thing I found to get CI to work was to run php -S localhost:8000 from the CI directory.


RE: Tutorial Issue? - qkzoo - 04-28-2015

(04-27-2015, 09:28 PM)n2fole00 Wrote: What server are you using? The easiest thing I found to get CI to work was to run php -S localhost:8000 from the CI directory.

I figured it out! I am running Nginx, anwill post my d had to add a rewrite line to my config. I will post my exact solution tonight when I get home.