![]() |
Problem after I change the default route - 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: Problem after I change the default route (/showthread.php?tid=42600) |
Problem after I change the default route - El Forum - 06-12-2011 [eluser]Unknown[/eluser] I can run a vanilla install of CI and get to the welcome screen, but I get an "HTTP 500 error" after I changed the following in application/config/routes.php Code: $route['default_controller'] = "welcome"; Code: log_message('debug','loaded ../application/config/routes.php'); It doesn't even load .../application/controllers/homepage.php Code: <?php logging is set to 4 and all I get is the following in the log Code: DEBUG - 2011-06-12 21:15:18 --> Config Class Initialized I'm running Linux, Ubuntu 10.10 PHP Version 5.3.3-1ubuntu9.5 The localhost runs files in /var/www phpmyadmin works and I can run other php code My buddy runs this code just fine, but he is using PHP5.2 and on a Mac Could it be the php version? If not, than any ideas? Problem after I change the default route - El Forum - 06-12-2011 [eluser]osci[/eluser] Code: class Homepage extends MY_Controller { Problem after I change the default route - El Forum - 06-13-2011 [eluser]Johnny Freeman[/eluser] Hey Saxywolf, the only thing I've noticed in your code that could be a problem is that you are extending MY_Controller instead of CI_Controller, but should not be the cause of a HTTP 500 ERROR. In my experience, .htaccess is usually (part of) the problem so I'd backup and delete the .htaccess and see if that helps. Another thing I just noticed was that you're using a closing php tag. It's generally a bad idea to use a closing php tag in your controllers, models, libraries, and helpers because you run the risk of allowing whitespace to creep in before the output buffer has been sent to the browser. Let me clarify: It is totally possible to use closing php tags without issue. However, why introduce another point of possible failure, especially when it's not necessary? Copy and paste this into your homepage controller and let us know what happens: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Problem after I change the default route - El Forum - 06-14-2011 [eluser]Unknown[/eluser] [quote author="Johnny Freeman" date="1308016990"]Hey Saxywolf, the only thing I've noticed in your code that could be a problem is that you are extending MY_Controller instead of CI_Controller, but should not be the cause of a HTTP 500 ERROR. In my experience, .htaccess is usually (part of) the problem so I'd backup and delete the .htaccess and see if that helps. Another thing I just noticed was that you're using a closing php tag. It's generally a bad idea to use a closing php tag in your controllers, models, libraries, and helpers because you run the risk of allowing whitespace to creep in before the output buffer has been sent to the browser. Let me clarify: It is totally possible to use closing php tags without issue. However, why introduce another point of possible failure, especially when it's not necessary? Copy and paste this into your homepage controller and let us know what happens: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); .../application/core/My_Controller.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); The only .htaccess file is in the .../application/ folder, but renaming it doesn't do anything. Simply replacing the Homepage.php code then yielded: Quote:ERROR - 2011-06-14 23:25:58 --> Severity: Notice --> Undefined property: CI_Loader::$ion_auth .../application/views/welcome_message.php 8So, I added Code: $this->load->library('ion_auth'); But I can't add: Code: $this->load->view('template', $page); Quote:ERROR - 2011-06-14 23:59:50 --> Severity: Notice --> Undefined variable: page .../application/controllers/homepage.php 21 So... is there something wrong with MY_Controller? The real troubling part is that the code I had is from a buddy whose mac it works on just fine. Problem after I change the default route - El Forum - 06-15-2011 [eluser]osci[/eluser] Code: $page['content'] = 'welcome message'; should not give an error. It's in home controller right? Not in my_controller. Second error if no page array is passed no $content will be found for view either. Problem after I change the default route - El Forum - 06-15-2011 [eluser]toopay[/eluser] Check your htaccess stuff. Or if it not exist, creates ones. In the past, while i start my new VPS, with ubuntu installed, i spend 2 hours just to figure it out that it need "?" or change one or two regex rules at that damn configuration file. Problem after I change the default route - El Forum - 06-15-2011 [eluser]madiha[/eluser] Establishes a set of ips allowed to pass validation FRC. Useful for external communication to the special website and other payment procesors. |