新浪SAE云平臺(tái)下使用codeigniter的數(shù)據(jù)庫(kù)配置

2013-02-19 18:34:02來(lái)源:cnblogs作者:令狐蔥

補(bǔ)充:由于SAE對(duì)文件權(quán)限的限制,cache目錄無(wú)法修改權(quán)限,因此原版Codeigniter無(wú)法直接使用?梢試L試http://code.google.com/p/ci-sae/。

補(bǔ)充:由于SAE對(duì)文件權(quán)限的限制,cache目錄無(wú)法修改權(quán)限,因此原版Codeigniter無(wú)法直接使用?梢試L試http://code.google.com/p/ci-sae/。

在database.php中配置如下:

$db['default']['hostname'] = SAE_MYSQL_HOST_M;
$db['default']['username'] = SAE_MYSQL_USER;
$db['default']['password'] = SAE_MYSQL_PASS;
$db['default']['database'] = SAE_MYSQL_DB;
$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';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['default']['port'] = SAE_MYSQL_PORT;

注意其中粗體的部分,不然會(huì)出現(xiàn)如下的錯(cuò)誤提示:

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 346

關(guān)鍵詞:SAEcodeigniterci

贊助商鏈接: