2
public function newreg()
    {
        $username = $this->input->post('username');
        $password = $this->input->post('password');

        $this->load->model('register_model');

        $data['list']=$this->register_model->add($username, $password);

        $this->load->view('register_display', $data);
    }

This is part of a controller named register.php once this function gets called, all I see on the screen is white space.

This function is an exact copy of a working one, from a working controller. Only the file names are changed (model, view)

I can't figure out where the problem is.

Ivan
  • 315
  • 3
  • 7
  • 17
  • 1
    what is the url you are trying accessing? did you removed index.php ? – itsme Jan 04 '13 at 21:31
  • url looks like http://www. IRRELEVANT.com/index.php/register/ – Ivan Jan 04 '13 at 21:32
  • 1
    @Ivan - It's really nice that we can go to a FREE website, and ask for FREE advice, from others that are offering their own time for FREE, and yet we can still be rude through our snide comments. Good luck with that! – swatkins Jan 04 '13 at 21:36
  • When have I been rude? I think you've misunderstood, I simply don't want my URL to be seen. – Ivan Jan 04 '13 at 21:40
  • 1
    Then maybe www.example.com would have been better than the snide "IRRELEVANT" comment - notice how @Badaboooooom has not offered any more help? That could be why. – swatkins Jan 04 '13 at 21:44
  • 1
    yep little bit rude, just i do not mind cause i'm not english, but i guess for english mother language, IRRILEVANt is too rude, stay quite ;) – itsme Jan 04 '13 at 21:47
  • Well, I can't edit it anymore. I'm not Egnligh either, if that matters. – Ivan Jan 04 '13 at 21:48

3 Answers3

7

You can easly check what's happening in the enteire envoirment by enalbing CI logs,

go to config/config.php and edit this:

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
|   0 = Disables logging, Error logging TURNED OFF
|   1 = Error Messages (including PHP errors)
|   2 = Debug Messages
|   3 = Informational Messages
|   4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/


  $config['log_threshold'] = 0; //put this to 4

then if you have not yet a /logs folder inside your /application folder, create that and add 775 chmod to that (logs folder only).

UPDATE: You must also chown apache:apache logs in order for apache to be able to write within that folder.

run your application by the browser and check inside your /logs folder the log.php file, it will contain all the application errors.

tofirius
  • 173
  • 2
  • 7
itsme
  • 48,972
  • 96
  • 224
  • 345
  • 1
    I did what you suggested. I set that setting to the number 4, up from 0. The logs folder alredy existed, I only changed permissions. After running my application there is no logs.php file. – Ivan Jan 04 '13 at 22:00
  • did you checked php logs too? – itsme Jan 04 '13 at 22:15
4

To see the errors instead of a white page, you need to change two options in the php.ini file:

  • error_reporting to E_ALL
  • display_error to On

See this answer for more information.

Community
  • 1
  • 1
antoyo
  • 11,097
  • 7
  • 51
  • 82
1

if you changed the file names, you also need to change the class names:

A file named my_class.php needs to have: class My_class extends CI_Controller {

so, if you took a working controller, copied it, and renamed the file. Then you also need to rename the class.

swatkins
  • 13,530
  • 4
  • 46
  • 78
  • Yeah, then I'd say turn on error reporting (would've thought you had tried that too) – swatkins Jan 04 '13 at 21:37
  • Error reporting is on, I have been able to see lots of error before this. And I never turned it off. – Ivan Jan 04 '13 at 21:39