CodeIgniter Forums
[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: [RESOLVED] Error Connecting to MySQL DB hosted by Media Temple (/showthread.php?tid=41745)



[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple - El Forum - 05-16-2011

[eluser]tkaw220[/eluser]
Finally I moved hosting to Media Temple, but is unable to connect to the database. Below is my DB config:

$db['default']['hostname'] = "internal-db.sxxxxxx.gridserver.com";
$db['default']['username'] = "xxxxx";
$db['default']['password'] = "xxxxx";
$db['default']['database'] = "xxxxx_name of database";
$db['default']['dbdriver'] = "mysqli";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

But I keep getting below error:

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/application/helpers/common_helper.php:149 Stack trace: #0 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/application/helpers/common_helper.php(149): SimpleXMLElement->__construct('') #1 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/application/views/includes/header.inc.php(6): get_location() #2 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/system/core/Loader.php(683): include('/nfs/c09/h01/mn...') #3 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/system/core/Loader.php(308): CI_Loader->_ci_load() #4 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/application/views/template.php(2): CI_Loader->view(Array) #5 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/system/core/Loader.php(683): include('/nfs/c09/h01/mn...') #6 /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/system/core/Loader.php(308): CI_Loader->_ci_load('includes/header...') #7 /nfs/c09/ in /nfs/c09/h01/mnt/xxxxxx/domains/xxxxxxxx/html/application/helpers/common_helper.php on line 149

What is wrong with my DB config?


[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple - El Forum - 05-16-2011

[eluser]eoinmcg[/eluser]
possibly nothing; the error is coming from /nfs/c09/h01/mnt/127190/domains/pelican.com.my/html/application/helpers/common_helper.php

from the above error message looks like there is a conflict from using short tags (i.e. <? ) in header.inc.php. best thing to do is not to use short tags but the full <?php


[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple - El Forum - 05-16-2011

[eluser]tkaw220[/eluser]
Hi,

Two functions named file_get_contents()and SimpleXMLElement() caused that error. But the server support SimpleXML, any idea how to fix it?

Thanks.


[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple - El Forum - 05-16-2011

[eluser]eoinmcg[/eluser]
post the code from common_helper.php, specifically showing us line 149, where the error occured.

from your first post the error posted has nothing to do with database or your database connection


[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple - El Forum - 05-16-2011

[eluser]tkaw220[/eluser]
Hi,

Found the error. It is due to the ipinfodb.com is not responding, thus no data is received by my code. It is solved now.