Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Tutorial News section
#14

(This post was last modified: 07-31-2015, 11:12 AM by Wouter60.)

Check if your controller has multiple index() and view() functions in it. Your example code that you posted earlier this week shows that it does. Function names inside a class must be unique. When the documentation says that you have to add code to the index function in your controller, don't create a new function, but put the extra code before the closing curly brace of the existing index function. The same goes for the view() function.

Besides all that,  you are not supposed to get an http 500 error, but a readable php error message on your localhost. Check your index.php file for the setting of the ENVIRONMENT constant. Does it say 'development' or 'production'?
Development suppresses php error messages. That's fine when your website is online, but while you are writing, testing and debugging your application, you want to see what's going wrong, don't you?

The http 500 error may also be caused by (a) bad server configuration or (b) an error in your .httaccess file.
To check (a): type http://localhost in your browser. You should get the welcome page of your server.
To check (b): rename your .htaccess file to .htaccess_org and try to start your website again. It should start the index.php file with your default controller.

If you are still getting the same error, please upload your News.php file as an attachment to this topic.
Reply


Messages In This Thread
RE: CodeIgniter Tutorial News section - by Wouter60 - 07-31-2015, 11:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB