Welcome Guest, Not a member yet? Register   Sign In
[RESOLVED] Error Connecting to MySQL DB hosted by Media Temple
#1

[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?
#2

[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
#3

[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.
#4

[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
#5

[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.




Theme © iAndrew 2016 - Forum software by © MyBB