摘要:本地测试环境中 apahche httpd-vhosts.conf 中添加虚拟主机例如 test.demo.com 增加变量 SetEnv CI_ENV \"development\" 本地hosts文件 增加对应 ip 如127.0.0.1 test.demo.com CI application config 文件夹中 config.php文件 添加以下信息 switch
本地测试环境中
apahche httpd-vhosts.conf 中添加虚拟主机例如 test.demo.com
增加变量
SetEnv CI_ENV "development"
本地hosts文件 增加对应 ip 如127.0.0.1 test.demo.com
CI application config 文件夹中 config.php文件
添加以下信息
switch (ENVIRONMENT)
{
case \'development\':
$config[\'base_url\'] = \'test.demo.com\';
break;
case \'production\':
$config[\'base_url\'] = \'www.demo.com\';
break;
}
数据库对应设置 以sae为例
CI application config 文件夹中 database.php文件
switch (ENVIRONMENT)
{
case \'development\':
$db[\'default\'] = array(
\'dsn\' => \'\',
/**** localhost ***/
\'port\' => \'3306\',
\'hostname\' => \'127.0.0.1\',
\'username\' => \'root\',
\'password\' => \'root\',
\'database\' => \'ci\',
/**************************/
\'dbdriver\' => \'mysqli\',
\'dbprefix\' => \'\',
\'pconnect\' => FALSE,
\'db_debug\' => (ENVIRONMENT !== \'production\'),
\'cache_on\' => FALSE,
\'cachedir\' => \'\',
\'char_set\' => \'utf8\',
\'dbcollat\' => \'utf8_general_ci\',
\'swap_pre\' => \'\',
\'encrypt\' => FALSE,
\'compress\' => FALSE,
\'stricton\' => FALSE,
\'failover\' => array(),
\'save_queries\' => TRUE
);
break;
default:
$db[\'default\'] = array(
\'dsn\' => \'\',
/**** sae配置 ***/
\'hostname\' => SAE_MYSQL_HOST_M,
\'port\' => SAE_MYSQL_PORT,
\'username\' => SAE_MYSQL_USER,
\'password\' => SAE_MYSQL_PASS,
\'database\' => SAE_MYSQL_DB,
/*************************/
\'dbdriver\' => \'mysqli\',
\'dbprefix\' => \'\',
\'pconnect\' => FALSE,
\'db_debug\' => (ENVIRONMENT !== \'production\'),
\'cache_on\' => FALSE,
\'cachedir\' => \'\',
\'char_set\' => \'utf8\',
\'dbcollat\' => \'utf8_general_ci\',
\'swap_pre\' => \'\',
\'encrypt\' => FALSE,
\'compress\' => FALSE,
\'stricton\' => FALSE,
\'failover\' => array(),
\'save_queries\' => TRUE
);
}
相关文章推荐
虚拟主机的专业参数,分别都是什么意思?2022-09-09
中非域名注册规则是怎样的?注册域名有什么用处? 2022-01-10
HostEase新年活动促销 美国/香港主机全场低至五折2021-12-28
HostGator下载完整备份教程分享2021-12-28
Flink中有界数据与无界数据的示例分析2021-12-28