Home > php教程 > php手册 > 新浪SAE云平台下使用codeigniter的数据库配置

新浪SAE云平台下使用codeigniter的数据库配置

WBOY
Release: 2016-06-13 09:33:53
Original
1181 people have browsed it

由于新浪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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template