Routing Issue - Windows vs Linux |
I am migrating from CI 2.x to 3.0. I tested the migrated code on my Windows machine and it works fine.
I am testing now on AWS Linux box and stuff is breaking. Getting 404s on my home page. The 404 message is The requested page ,, was not found To debug, I dumped the my_router object from Codeigniter.php after the load class Code: $RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL); Here are some snippets from the dump Non working machine - AWS Linux MY_Router Object [module] => pages [config] => CI_Config Object ... identical between the 2 machines [routes] ... identical between two machines Code: [routes] => Array [class] => Note: (empty) --> Not sure why! [method]=>index [directory]=>../modules/pages/controllers [default_controller] => index On a Windows machine where the migrated solution works correctly, the MY_ROUTER dump snippet is [module]=> index [class] => index [method]= index [directory] ../modules/index/controllers/ [default_controller] => index/index I am puzzled as to why the pages module is being loaded on the Linux machine first whereas the index module is being loaded first on Windows machine . Also the default controller is different. I copied the exact set of files from the Windows machine to linux box. PHP version on AWS is 5.6.25 and 5.6.22 on Windows. Comparing logs between machines the Index MX_controller class never seems to be get initialized in the Linux machine. I wonder if this is a case sensitive issue Any pointers appreciated.
It likely is a "case" issue. At least that would be the first place to look.
Check out this upgrading doc for more info.
'Index' controllers are documented as "reserved names" and shouldn't be used.
They are not technically reserved by the framework itself, but since you'll likely have an index() method as well, that would be triggered as a PHP4-style constructor, so ... (10-03-2016, 12:48 AM)Narf Wrote: 'Index' controllers are documented as "reserved names" and shouldn't be used. Thank you. |
Welcome Guest, Not a member yet? Register Sign In |