我在CodeIgniter
中开发了一个php应用程序。我想在我的托管网站hostinger上测试我的应用程序,所以我已经上传了所有文件并配置了连接到数据库的脚本。但是我收到了以下消息:无法使用Hostinger提供的设置连接到您的数据库服务器
无法使用提供的设置连接到数据库服务器。
在我Hostinger帐户信息,我可以看到:
host: http://xxx.xx.xx
database host: xxx.xxx.xxx
database name: xxx
database username: xxx
database password: ******
这是我configuration
文件:
<?php
class SystemConfiguration {
// General Settings
public static $base_url = 'http://primodebug.esy.es/Calendario/';
// Database Settings
public static $db_host = 'xxx';
public static $db_name = 'xxx';
public static $db_username = 'xxx';
public static $db_password = '*****';
// Google Calendar API Settings
public static $google_sync_feature = FALSE; // Enter TRUE or FALSE;
public static $google_product_name = '';
public static $google_client_id = '';
public static $google_client_secret = '';
public static $google_api_key = '';
}
/* End of file configuration.php */
/* Location: ./configuration.php */
我在做什么错?
UPDATE笨配置文件
$active_group = 'default';
$active_record = TRUE;
require_once dirname(dirname(dirname(__FILE__))) . '/configuration.php';
$db['default']['hostname'] = SystemConfiguration::$db_host;
$db['default']['username'] = SystemConfiguration::$db_username;
$db['default']['password'] = SystemConfiguration::$db_password;
$db['default']['database'] = SystemConfiguration::$db_name;
$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';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */
可能重复的[CodeIgniter:无法连接到您的数据库服务器使用提供的设置错误信息](http://stackoverflow.com/questions/7254049/codeigniter-unable-to-connect-到你的数据库服务器使用提供settin) – Alex
谢谢亚历克斯,但我刚刚阅读这个问题,用户已经使用<?而不是<?php,这不是我的情况。 – Dillinger
http://stackoverflow.com/questions/1808365/difference-between-php-and – Alex