Windows XP and IIS 6.0 |
[eluser]viral007in[/eluser]
Hi All Please help me out in this issue I am facing with, as I am new to codeigniter. I have installed codeigneter in 2 different folders and accordingly set IIS for the same the folder names are as follows 1) d:\codeig 2) d:\websites\codeigniter by default I run this site It display default welcome message properly. But when I create a Blog from your site to test it does not work. class Blog extends Controller { function index() { echo 'Hi Blog'; } } my config is as follows $config['base_url'] = "http://localhost/"; whats is wrong in all this please guide me..
[eluser]mdcode[/eluser]
Only being new to this myself, for one thing that I can see here, you need to set the parent controller to the "Blog" page, before you do anything with index(): Code: function Blog() In addition, I would seriously recommend that you develop your site on an Apache based web server like XAMPP or WebServ. Not a lot of hosting options are out there for Windows based servers and they can be unreliable to code on. They also tend to be more expensive too.
[eluser]jedd[/eluser]
Hi viral007in, and welcome to the forums. The suggestion to use Apache might not be so bad, actually - you tend to find more people using it, especially on forums, and if you're new to this stuff then the benefit might be worth the time spent now in setting it up. I haven't used IIS much, but I thought things needed to be under WWWROOT or some such? Presumably that's configurable, and I'm assuming that since you've got the test site working, then that aspect of IIS's configuration is okay. Can you please post the whole of your Blog controller - I'm hoping you just edited out the constructor method in the example you posted above. (Also have a play with the code tags you can use in the editor when posting - it highlights the syntax of your code and looks real perdy.) What URL did you use to try to get to the blog page? It should have been something like http://localhost/blog/
[eluser]viral007in[/eluser]
Actually I am having to files in the controller folder 1) welcome.php 2) blog.php What actually I was trying to do is putting a simple blog test how are thing working. I am access the site by using http://localhost/codeig/index.php/blog/ But it gives error message page not found. HTTP 404 page not found. Contain of blog file are as follows Filename: blog.php Code: class Blog extends Controller {
[eluser]TheFuzzy0ne[/eluser]
Try setting $config['uri_protocol'] in config.php from AUTO to either QUERY_STRING or REQUEST_URI (I forget which works best).
[eluser]jedd[/eluser]
Okay .. Quote:I am access the site by using http://localhost/codeig/index.php/blog/That fails, but http://localhost/codeig/index.php/ works, yes? EDIT: my bad wrt constructor requirements.
[eluser]viral007in[/eluser]
Even using constructor it dose not work. http://localhost/codeig/index.php/ this works but this does not work http://localhost/codeig/index.php/blog/ Code: class Blog extends Controller {
[eluser]jedd[/eluser]
Well, it's looking a lot like a permissions problem, which would otherwise seem doubtful because MS-IIS is not well known for being conservative with security of its files. If you are really lacking a <?php at the start of your controller (as shown) then I'd expect a lot of raw HTML on-screen, rather than a 404. Unless perhaps IIS is trying to be smart there .. ? I'm not sure if CI requires the <?php opener - it's on my pages here, and if I remove it it breaks things quite badly, but that might be due to changes I've made. Worth a try while you're waiting for someone smarter to suggest something else.
[eluser]TheFuzzy0ne[/eluser]
Is there something wrong with what I suggested?
[eluser]viral007in[/eluser]
My code as both opening and closing tag Code: <?php ?> If change the default page to Blog it works but when I change it to welcome page, the blog page does not work |
Welcome Guest, Not a member yet? Register Sign In |