新浪SAE云平台下使用codeigniter的数据库配置
由于新浪SAE对文件权限的限制,cache目录无法修改权限,因此原版Codeigniter无法直接使用。可以尝试codeIgniter 2.10 for SAE: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;
注意其中$db['default']['dbdriver'] 与$db['default']['pconnect']项,不然会出现如下的错误提示:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
相关推荐
klarclm 2020-06-14
carolAnn 2020-05-09
JF0 2020-03-02
hithyc 2020-01-18
suixinsuoyu 2020-01-18
amberom 2020-01-06
xcguoyu 2019-12-25
wmsjlihuan 2019-04-14
whoisyoya 2018-01-14
rinkback00 2017-08-10
刘阳龙Herman 2019-03-28
ginkgodia 2013-05-30
misszc 2009-04-19
nellson 2019-07-01
怕什么真理无穷 2019-07-01
Allchin 2015-05-27
haoxun0 2011-12-21
shishaoe 2015-02-10
静心斋 2015-02-10