![]() |
Views not finding Controllers on lighttpd - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Views not finding Controllers on lighttpd (/showthread.php?tid=20368) |
Views not finding Controllers on lighttpd - El Forum - 07-07-2009 [eluser]joe-bbb[/eluser] I built my site locally running on apache, it works fine. When transferring to my ubuntu vps running lighttpd, my views do not seem to be loading the controllers or views. I get a very short snippet of my view printed when i go to http://my-app-address/index.php/myview. When I view this locally, a full webpage (with header, footer etc.) is shown. I can select and view from my database fine if i do this all in the view, however, it is clearly not finding the controller or model. I have a suspicion that this is connected to my uri_protocol line in my config.php though I have tried every variation without any success. I am not using any mod_rewrite stuff yet. Thanks in advance Views not finding Controllers on lighttpd - El Forum - 07-07-2009 [eluser]Gordaen[/eluser] I'm not sure what you mean by it's not loading the controllers or views? Or what you mean by not finding the controller or model? If you're running it with php-fastcgi, you may have to set your config like this: Code: $config['uri_protocol'] = "REQUEST_URI"; and be sure to pass on all the appropriate variables Code: fastcgi_param QUERY_STRING $query_string; Views not finding Controllers on lighttpd - El Forum - 07-08-2009 [eluser]joe-bbb[/eluser] Thanks for the response - I'll provide a link - http://raremusicrecordings.co.uk/index.php/home In this view if I write the code to select from my db and echo in this file I can show contents of the db easily, however when the SELECT is in the controller or model, I get the result shown. I am not using php-fastcgi. Thanks Views not finding Controllers on lighttpd - El Forum - 07-08-2009 [eluser]TheFuzzy0ne[/eluser] It looks like you might be using short tags when they aren't supported by your server. Also, you're view shouldn't be loading any helpers, that should all be done in the controller IMHO. CodeIgniter can be set to parse short tags on servers that don't support it, but it comes at the cost of a little more overhead. Views not finding Controllers on lighttpd - El Forum - 07-08-2009 [eluser]joe-bbb[/eluser] Quote:It looks like you might be using short tags when they aren’t supported by your server. By short tags I take it you are meaning just replacing <? with <?php right? Quote: Also, you’re view shouldn’t be loading any helpers, that should all be done in the controller IMHO. Yeah that makes sense, I'll let you know how i got on with that after work. Thanks Views not finding Controllers on lighttpd - El Forum - 07-08-2009 [eluser]TheFuzzy0ne[/eluser] That's correct. Short tags usually come in the following formats: Code: <? $this->load->view('some_view') ?> Here's a link to the CodeIgniter PHP Style Guide if you're interested - http://ellislab.com/codeigniter/user-guide/general/styleguide.html. Adhering to it can save you a lot of potential headaches. ![]() Views not finding Controllers on lighttpd - El Forum - 07-08-2009 [eluser]joe-bbb[/eluser] Thank you - It was the short tags I've gone through and changed them to proper start tags now and all is well, really appreciate all the help and rapid response Views not finding Controllers on lighttpd - El Forum - 07-09-2009 [eluser]TheFuzzy0ne[/eluser] I'm glad you got it sorted. ![]() |