Welcome Guest, Not a member yet? Register   Sign In
A 500 internal server issue with a model
#1

[eluser]ChrisD[/eluser]
Hello,

Been fighting with a problem for a couple days now and cannot figure out what's wrong. I've managed to narrow it down to my logs model as the error no longer occurs if I comment out the load call for that model. Error logs are only showing this:

Quote:[Wed Apr 25 12:29:53 2012] [warn] [client xxx.xxx.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Apr 25 12:29:53 2012] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: ci_index.php

I only just started the logs model so it only has one function at the moment:

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
* Logs
*
* Model for logging user actions
*
*/

class Logs extends CI_Model
{


function __construct()
{
                parent::__construct();
                $this->load->model('users');
}


/**
  * Input password change for user into log
  *
  * Requires - User ID as string
  * Returns - NULL
  */        
        function password_change($user_id)
        {
            //check valid user ID
            if($this->users->is_valid_uid($user_id))
            {
                //User ID is valid, setup query
                $c_date = date("Y-m-d H:i:s");
                $this->db->set('Member',$user_id);
                $this->db->set('Date',$c_date);
                $this->db->set('UpdatedBy',$user_id);
                $this->db->set('UpdatedByIP','123');
                $this->db->insert('wcc_logs_password_change');
            }
        }


}

/* End of file logs.php */
/* Location: ./application/models/logs.php */

Anyone see what's wrong with the code?
#2

[eluser]vitoco[/eluser]
Did you enable display_errors and use error_reporting( E_ALL ) to see what happened ? no output?
#3

[eluser]ChrisD[/eluser]
That's correct, I've got it setup to ouput all errors, warnings and notifications at the moment but it's not outputting anything.
#4

[eluser]vitoco[/eluser]
can you post your controller code?
#5

[eluser]ChrisD[/eluser]
I'm not sure what I did to fix it, but it's working all of a sudden. I was cutting out pieces trying to figure out what part of the code was causing the issue, now all of a sudden it's working but the code is the exact same as I posted above
#6

[eluser]InsiteFX[/eluser]
500 is a server error and has nothing to do with CodeIgniter!

The error is saying that the server reset the database connection.

Which is most likly a a server timeout problem.
#7

[eluser]CroNiX[/eluser]
I'd increase the values for some of your FCGID settings, minimally:
IPCConnectTimeout and IPCCommTimeout. They should be equal to or greater than your php timeout settings.

These might need to be adjusted as well: IdleScanInterval, BusyScanInterval and ZombieScanInterval




Theme © iAndrew 2016 - Forum software by © MyBB