我是CodeIgniter的新手。我正在尝试在我的本地主机上建立CodeIgniter站点。该站点联机运行良好。以下是我将站点迁移到我的本地主机所采取的步骤。
1.我在application/config/congfig.php中编辑了base_url
$config['base_url'] = "http://localhost/MyProjects/Project/reservation/";
1.我更改了application/config/database.php中的数据库连接设置,以连接到localhost数据库
1.我已经建立了数据库
工作网站URL如下所示:www.example.com/reservation/index.php
我已将站点文件放在本地服务器的MyProjects/Project目录中。我正在尝试访问
'http://localhost/MyProjects/Project/reservation/index.php'
但它返回空白页。(空body元素:)
下面是应用程序\配置\路由. php的内容
$route['default_controller'] = "admin";
$route['scaffolding_trigger'] = "";
require_once BASEPATH.'database/DB'.EXT;
$db_obj = DB();
$new_branches = $db_obj->get('table_branches');
$new_branches = $new_branches->result();
foreach($new_branches as $branch){
$route[trim($branch->url)] = "reserve/index/".$branch->url;
$route[trim($branch->url).'/'] = "reserve/index/".$branch->url;
$route[trim($branch->url).'/admin'] = "admin";
}
有人能帮我吗?
1条答案
按热度按时间dxxyhpgq1#
路由文件中的第3行有错误:
应该修复它:
在index.php文件中,将ENVIRONMENT更改为development以显示错误: