I’m getting the below error on my server:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /nfs/c03/h03/mnt/53496/domains/chuggington.com/deploy/releases/20100908062138/system/application/models/home_model.php on line 5
However, the code works in a different part of the server (the development side). This is me trying to put it live.
Below is the code it is referring to:
<?php
class Home_model extends Model {
public function Home_model()
{
// model constructor
parent::Model();
}
function getCode(){
$ip_address = 'INET_ATON('.$_SERVER['REMOTE_ADDR'].')';
//echo $_SERVER['REMOTE_ADDR'];
$this->db->select('country');
$this->db->order_by('ip', 'desc');
$query = $this->db->get_where('ip2nation', array('ip <'=>$ip_address), '0,1');
//print_r($query->row('country'));
return $query->row('country');
}
}
?>
Can syslink cause this sort of error? There are no htaccess scripts interfering either.
Thanks
—EDIT—
I have run a phpinfo on the site and it’s running php 5.2.6. I’ll try the addhandler change and see if that works.
Just tried the addhandler and i’m still getting the same error.
Some hosts may offer both PHP4 and PHP5 environments and require you to choose one or the other, defaulting to PHP4. Our host requires a
AddHandler php5-script .phpline in the .htaccess file of directories that should use PHP5. Others may offer a switch in a control panel.Consult your host’s manual.