![]() |
New site file not found issues - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: New site file not found issues (/showthread.php?tid=12642) Pages:
1
2
|
New site file not found issues - El Forum - 10-26-2008 [eluser]Dahak-II[/eluser] After having had CodeIgniter thrust upon me at the office, I've grown to like it. I am doing a long-overdue rewrite of my personal site using the new framework as a familiarization exercise. The obvious must be escaping me. This will turn out to be a noob issue, but other than getting the default index controller functioning, I can't get any other controllers to function. I get the dreaded Page Cannot Be Found result. I'm using the newest release, v1.7.0 and my initial set up is pretty plain vanilla. The routes.php file only has one change: Code: $route['default_controller'] = "home"; I autoload: Code: $autoload['helper'] = array('cookie', 'url', 'html', 'file'); The only significant change to the config.php file is: Code: if (stristr(PHP_OS, 'WIN')) { ...since I'm developing it locally on a Windows XP box running IIS and deploying it to a Linux-based Apache machine. Requesting http://127.0.0.1/ or http://127.0.0.1/index.php works fine, but http://127.0.0.1/index.php/home/index/ or http://127.0.0.1/index.php/home/book/title/ do not, as I expect they should. No other controllers can be called, either. The controller set up is pretty plain: Code: class Home extends Controller { Any idea on what simple, blindingly obvious configuration issue I might be missing? The site behaves the same on the local Windows XP/IIS and remote Linux/Apache servers. Thanks. New site file not found issues - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] Hi, You'll likely need to adjust the : $config['uri_protocol'] = "AUTO"; // maybe PATH_INFO ? Setting in config.php as well. Watch for this when deploying to your linux box. I might recommend putting your same switch over this setting as well once you figure out what works. Randy New site file not found issues - El Forum - 10-26-2008 [eluser]Dahak-II[/eluser] [quote author="Randy Casburn" date="1225057674"]Hi, You'll likely need to adjust the : $config['uri_protocol'] = "AUTO"; // maybe PATH_INFO ? Setting in config.php as well. Watch for this when deploying to your linux box. I might recommend putting your same switch over this setting as well once you figure out what works. Randy[/quote] Thanks, but so far, the local Win XP/IIS server doesn't seem to like any of the available options any better. New site file not found issues - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] What shows up in your $_SERVER array when you dump it with your request for index.php/home/index/ ? Looking specifically for ['ORIG_PATH_INFO'] or ['PATH_INFO'] to contain these. If they do, you should be able to use those (or where ever it shows up in your $_SERVER array. Randty New site file not found issues - El Forum - 10-26-2008 [eluser]Dahak-II[/eluser] [quote author="Randy Casburn" date="1225062717"]What shows up in your $_SERVER array when you dump it with your request for index.php/home/index/ ? Looking specifically for ['ORIG_PATH_INFO'] or ['PATH_INFO'] to contain these. If they do, you should be able to use those (or where ever it shows up in your $_SERVER array. Randty[/quote] I can't get the $_SERVER array when I attempt to directly call a controller, I get page not found. For the default index, the local box reports ORIG_PATH_INFO = /index.php and URL = /index.php which, when configured, give me CI 404 pages. I've been trying other globals, with no success yet. Should I be looking for a scrip name or a full URL (ie '/index.php' or 'http://dev.thefifthimperium.com/index.php')? Thanks. New site file not found issues - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] yea...replace your index.php file with a temporary replacement to do this test. just to capture the url and report the $_SERVER array. We just need to see how IIS is putting things together for you. Then we'll put things back together. Randy New site file not found issues - El Forum - 10-26-2008 [eluser]Dahak-II[/eluser] [quote author="Randy Casburn" date="1225065157"]yea...replace your index.php file with a temporary replacement to do this test. just to capture the url and report the $_SERVER array. We just need to see how IIS is putting things together for you. Then we'll put things back together. Randy[/quote] Here are the relavant globals for the local IIS server when requsting the script http://127.0.0.1/this/is/a/test/path/script.php Code: SCRIPT_NAME = [ /this/is/a/test/path/script.php ] I've already tested most of these without success. And, to make life more interesting, not all of the same globals are provided by the Linux/Apache server. Thanks for your help. New site file not found issues - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] OK, we can see the correct path is stored in both 'ORIG_PATH_INFO' and 'REQUEST_URI' on your IIS server. So let's stick with one of those for now. We'll need to establish why CI will not recognize these. I'm a little busy at the moment, but that is where we need to turn next. Randy New site file not found issues - El Forum - 10-26-2008 [eluser]Dahak-II[/eluser] [quote author="Randy Casburn" date="1225082517"]OK, we can see the correct path is stored in both 'ORIG_PATH_INFO' and 'REQUEST_URI' on your IIS server. So let's stick with one of those for now. We'll need to establish why CI will not recognize these. I'm a little busy at the moment, but that is where we need to turn next. Randy[/quote] No problem. Thanks for the time you've already spent. I've turned on full logging and the local box seems to be generating two unexpected permission denied file-access warnings. The Linux box doesn't report any logged warnings. I added some debug logging to the URI library. When loading the /index.php file, it resolves the URI to the default empty string. Nothing gets logged when the browser fails to load my book() controller. -Joe New site file not found issues - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] Put an this statement at line 112 of libraries/URI.php: echo $_SERVER['ORIG_PATH_INFO']; The very next line (line 113 should be: $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); --- Let's see what get's echo'd Randy |