CI 框架访问 http://[::1]/yourproject/
Chances are you have left the base url blank
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = '';
Go to application/config/config.php set base_url
$config['base_url'] = 'http://localhost/example/';
Then ::1
error should be gone.
Now days in latest versions of codeIgniter it is not recommend that you leave your base_url blank.
$config['base_url'] = 'http://localhost/yourproject/';
$config['base_url'] = 'http://www.example.com/';
And is always good to end url with /
二:此原因及升级版本后,CodeIgniter-3.0.6\system\core\Config.php 构造函数体内 $_SERVER['SERVER_ADDR'] 造成,改成 $_SERVER['HTTP_HOST'],做相应调整亦可。
CI 框架访问 http://[::1]/yourproject/的更多相关文章
- 关于CI框架访问数据库类提示Call to undefined function mysqli_init()
大家好,我曾经是ASP.NET MVC的践行者,现在是PHP,同时也是CodeIgniter框架的初学者和践行者,当时由于项目原因,我被迫给自己打满鸡血,满怀激情的选用Yii2,Lavarel5,Co ...
- 关于 CI框架访问数据库类提示Call to undefined function mysqli_init() 问题解决
我上次实践发现,安装在Win10 WampServer3.0.4集成环境,不仅打不开phpmyadmin会报错就算了,而且报错后又没提示那么解决,同时你打开php扩展配置发现,WampServer系统 ...
- CI 框架 隐藏index.php 入口文件 和 设置访问application下子目录
1.隐藏根目录下 index.php, 在根目录下创建 .htaccess文件 内容如下: <IfModule mod_rewrite.c> RewriteEngine on Rewrit ...
- 第一天ci框架开发商城1
ci框架开发商城1 1/28/2016 9:43:52 PM userguide删除 system application controllers 控制器 models 模型 views 视图 模板 ...
- CI框架入门1
CI框架入门: 1.url的特点 2.目录结构/布局 3.MVC分别在哪里,如何依葫芦画瓢 4.安全性 ...
- CI框架整合yar
第一步:在CI框架中libraries目录下建立yar.php 文件 内容: <?php /** * yar 接口 */ class Yar { /** * 构造函数 * * @return v ...
- CI框架源码阅读笔记4 引导文件CodeIgniter.php
到了这里,终于进入CI框架的核心了.既然是“引导”文件,那么就是对用户的请求.参数等做相应的导向,让用户请求和数据流按照正确的线路各就各位.例如,用户的请求url: http://you.host.c ...
- CI框架源码阅读笔记3 全局函数Common.php
从本篇开始,将深入CI框架的内部,一步步去探索这个框架的实现.结构和设计. Common.php文件定义了一系列的全局函数(一般来说,全局函数具有最高的加载优先权,因此大多数的框架中BootStrap ...
- CI框架源码阅读笔记1 - 环境准备、基本术语和框架流程
最开始使用CI框架的时候,就打算写一个CI源码阅读的笔记系列,可惜虎头蛇尾,一直没有行动.最近项目少,总算是有了一些时间去写一些东西.于是准备将之前的一些笔记和经验记录下来,一方面权作备忘,另一方面时 ...
随机推荐
- Linux_系统管理命令(工作中经常使用到的)
查看网络配置信息 ifconfig 查看系统资源信息(类似win系统资源管理器) top (ps: load average 负载 Task 进程 Cpus/Mem swap 交换分区 类似wi ...
- inline,block,inline-block的区别
display:block block元素会独占一行,多个block元素会各自新起一行.默认情况下,block元素宽度自动填满其父元素宽度. block元素可以设置width,height属性.块级元 ...
- DateFormatUtil.java
package com.vcredit.framework.utils; import java.sql.Timestamp;import java.text.DateFormat;import ja ...
- Web前端开发基础 第二天(各类标签)
认识标签(第二部分): <ul> <li>信息</li> <li>信息</li> ...... </ul> <ol> ...
- Linux LVM过程问题
问题: 使用fdisk 修改完成磁盘后,在/etc/下没有出现新建的分区文件 解决: 重启系统 (好吧,这他妈也算解决方案~~)
- loading.gif
- 省略号 对单行 多行的css
.twoline{ display: -webkit-box !important;; overflow:hidden; text-overflow: ellipsis; word-break: br ...
- DS Tree 已知先序、中序 => 建树 => 求后序
参考:二叉树--前序和中序得到后序 思路历程: 在最初敲的时候,经常会弄混preorder和midorder的元素位置.大体的思路就是在preorder中找到根节点(根节点在序列的左边),然后在mid ...
- vim正则表达式(转)
Vim中的正则表达式功能很强大,如果能自由运用,则可以完成很多难以想象的操作. 如果你比较熟悉Perl的正规表达式,可以直接参照与Perl正则表达式的区别一节. 一.使用正则表达式的命令 使用正则表达 ...
- centos同步北京时间
yum install ntp ntpdate #ntpdate -u 202.120.2.101 //写入硬件 #hwclock -w 以下是国内常见的NTP服务器 ntp.sjtu.edu.cn ...