Welcome Guest, Not a member yet? Register   Sign In
database connection with media temple
#1

[eluser]noussh[/eluser]
These are my configuration details in database.php.
I have a news table, i am pulling data to a my news controller. It worked fine on localhost. But when i moved to production server i am getting these errors.

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /mnt/gs01/herd02/35771/domains/noussh.com/html/system/application/config/database.php on line 55

Code:
$db['default']['hostname'] = "$_ENV['DATABASE_SERVER']";
$db['default']['username'] = " ******* ";
$db['default']['password'] = " ******* ";
$db['default']['database'] = " ******* ";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
#2

[eluser]wiredesignz[/eluser]
So, which is line 55 ?

This might help:
http://www.google.com/search?hl=en&q=une...rch&meta;=

But I bet its the first line, remove the quotes.
#3

[eluser]Glen Swinfield[/eluser]
May not be your problem bu this line:

$db['default']['hostname'] = "$_ENV['DATABASE_SERVER']";

should be:

$db['default']['hostname'] = $_ENV['DATABASE_SERVER'];

(no quotes)
#4

[eluser]noussh[/eluser]
@wiredesginz, line 55 was db host name $db['default']['hostname'] = "$_ENV['DATABASE_SERVER']";, yeah i did google it and i knew it's something to do with quotes.

@Glen Swinfiled, thanks man it worked.

here is the hosted link. http://www.noussh.com/news. What if i don't want my pages not cached at all. I placed $this->output->cache(0); in every controller. But still i get cached pages. Now the only solutions works for me is remove 'www' from url.
#5

[eluser]Glen Swinfield[/eluser]
Have you deleted the cached files? - you need to do this to stop them being called.
#6

[eluser]noussh[/eluser]
Yes, i deleted the cache folder. Still get the same error. Is it safe to use base url with 'www'?
#7

[eluser]BaRzO[/eluser]
if your server running on php 4.xx and if your local is php 5.xx you should try this open your php files make yout short type codes to long type...

find this kind of lines

$query = $this->db->select('name')->get('category')->result();

change them like this

$this->db->select('name');
$query = $this->get('category');
$result = $query->result();




Theme © iAndrew 2016 - Forum software by © MyBB