【发布时间】:2017-02-17 07:04:43
【问题描述】:
我正在开发一个具有 MVC 架构并使用 codeigniter 框架的项目。当我尝试按以下方式运行文件时,我不断收到错误。
http://localhost:9080/internship-management/sourcecode/codeigniter/index.php/vacancyManagement
我已经在config目录下的config.php文件中设置了base_url如下
*/
$config['base_url'] = 'http://localhost:9080/internship-management/sourcecode/codeigniter/';
/*
我的项目 Internship-Management 在 wamp 的 www 下的 C 盘内。
C:\wamp\www\Internship-Management\SourceCode\CodeIgniter
控制器的项目结构如下
尝试使用开头指定的路径运行控制器后(打开 wamp 服务器后),我收到此错误
在这方面的任何帮助都将受到高度赞赏,因为我已经为此思考了好几个小时了,我知道这是微不足道的
【问题讨论】:
-
@Anish 我收到了这个请求的 url not found 错误。
The requested URL /Internship-Management/SourceCode/CodeIgnite‌​r/index.php/vacancyManagement was not found on this server. -
您的控制器文件夹中有一个名为
vacancyManagement.php的文件吗?似乎这是主页控制器,服务器找不到它。另外,您的路径中有.htaccess文件吗? -
@AhmedEssam 我在控制器下有 vacancyManagement,如上图所示(项目结构)
-
你在使用 CodeIgniter 3 吗?如果是这样,那么您需要将文件的第一个字母大写。此要求已在 CodeIgnier 3 codeigniter.com/userguide3/installation/… 中添加
标签: php codeigniter url model-view-controller localhost