CodeIgniter Forums
Created sample controller not displayed - 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: Created sample controller not displayed (/showthread.php?tid=63189)



Created sample controller not displayed - ksanthosh77 - 10-05-2015

Hello all,

I am using code igniter with nginx,such that I have installed nginx and code igniter on virtual box(Ubuntu). I am accessing the Code igniter file from windows(hosts machine). Now on accessing the url

http://example.com:8080/index.php is working fine with the code igniter welcome index page

But when i create a sample blog.php under application/controllers/blog.php with the following code.
<?php

class Blog extends CI_Controller{

public function index(){

echo "Hello this is blog";
}
}

1) When i try to access http://example.com:8080/index.php/blog results-404 page not found -error
2) and with url http://example.com:8080/index.php/blog.php results -No input file specified. -error

Please help to display blog page by overcoming the errors stated above or in the above which one is right way to call the class name. I do not know what I am wrong with.

fyi, Ubuntu version 14.04, code igniter 3.0.1 and nginx 1.8.7

Thank you for the help.
Ksanth


RE: Created sample controller not displayed - pdthinh - 10-05-2015

(10-05-2015, 05:51 AM)ksanthosh77 Wrote: Hello all,

I am using code igniter with nginx,such that I have installed nginx and code igniter on virtual box(Ubuntu). I am accessing the Code igniter file from windows(hosts machine). Now on accessing the url

http://example.com:8080/index.php is working fine with the code igniter welcome index page

But when i create a sample blog.php under application/controllers/blog.php with the following code.
<?php

class Blog extends CI_Controller{

            public function index(){

                          echo "Hello this is blog";
                                          }
}

1) When i try to access http://example.com:8080/index.php/blog   results-404 page not found -error
2) and with url http://example.com:8080/index.php/blog.php  results -No input file specified. -error

Please help to display blog page by overcoming the errors stated above or in the above which one is right way to call the class name. I do not know what I am wrong with.

fyi, Ubuntu version 14.04, code igniter 3.0.1 and nginx 1.8.7

Thank you for the help.
Ksanth

Your controller should name Blog.php (first letter capitalized)