CodeIgniter Forums
Moved website from localhost to Linux but database not updating - 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: Moved website from localhost to Linux but database not updating (/showthread.php?tid=55529)



Moved website from localhost to Linux but database not updating - El Forum - 10-30-2012

[eluser]friday[/eluser]
Hi,

I have a perfectly working CI website that I moved to a Linux server. I set

Code:
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;

in database.php. The website has a form where user inputs are updated into the database - however the database is not updating on the Linux server (otherwise running fine). Am I missing something?


Moved website from localhost to Linux but database not updating - El Forum - 10-30-2012

[eluser]solid9[/eluser]
What is the error message?
Along with the error message post the codes that you think is the issue.


Moved website from localhost to Linux but database not updating - El Forum - 10-31-2012

[eluser]friday[/eluser]
There is no error message because the database connects properly; but nothing updates after queries.

Here is the controller where I take a value from a form in view:

Code:
/*load model*/

  $this->load->model('Form');  
  
/* Get Income */
$income=$this->input->post('element_0');
$this->Form->insert_x($income);

Here is the model which is supposed to pass $income into the database:

Code:
<?php

class Form extends CI_Model {

    function __construct()
    {
        $this->load->database();
        parent::__construct();
    }


function insert_x($data)
{
$data=array('value'=>$data);
$this->db->where('id', 1);
$this->db->update('table2', $data);
}

This works in localhost. I also turned autoload database off in autoload.php. But it's not working when this is uploaded in Linux.


Moved website from localhost to Linux but database not updating - El Forum - 10-31-2012

[eluser]xeroblast[/eluser]
i dont know if this is correct and hope you give it a try..

interchange:
Code:
parent::__contruct();
$this->load->database();

use different variable:
Code:
function insert_x($val) {
$data=array( 'value' => $val );
$this->db->where( 'id', 1 );
return $this->db->update( 'table2', $data );
}



Moved website from localhost to Linux but database not updating - El Forum - 10-31-2012

[eluser]friday[/eluser]
I found the error log and it says this:

[Wed Oct 31 13:34:55 2012] [crit] [client 172.22.66.90] (13)Permission denied: /home/ee4717g48/htdocs/application/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: hxxp://xxx/~EE4717G48/

There are several htaccess files created all around the CI folders, as can be seen here: http://i50.tinypic.com/o05j6u.png

All of these .htaccess files have "Denied to all" written inside it. How can this be fixed?