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/的更多相关文章

  1. 关于CI框架访问数据库类提示Call to undefined function mysqli_init()

    大家好,我曾经是ASP.NET MVC的践行者,现在是PHP,同时也是CodeIgniter框架的初学者和践行者,当时由于项目原因,我被迫给自己打满鸡血,满怀激情的选用Yii2,Lavarel5,Co ...

  2. 关于 CI框架访问数据库类提示Call to undefined function mysqli_init() 问题解决

    我上次实践发现,安装在Win10 WampServer3.0.4集成环境,不仅打不开phpmyadmin会报错就算了,而且报错后又没提示那么解决,同时你打开php扩展配置发现,WampServer系统 ...

  3. CI 框架 隐藏index.php 入口文件 和 设置访问application下子目录

    1.隐藏根目录下 index.php, 在根目录下创建 .htaccess文件 内容如下: <IfModule mod_rewrite.c> RewriteEngine on Rewrit ...

  4. 第一天ci框架开发商城1

    ci框架开发商城1 1/28/2016 9:43:52 PM userguide删除 system application controllers 控制器 models 模型 views 视图 模板 ...

  5. CI框架入门1

    CI框架入门: 1.url的特点             2.目录结构/布局             3.MVC分别在哪里,如何依葫芦画瓢             4.安全性             ...

  6. CI框架整合yar

    第一步:在CI框架中libraries目录下建立yar.php 文件 内容: <?php /** * yar 接口 */ class Yar { /** * 构造函数 * * @return v ...

  7. CI框架源码阅读笔记4 引导文件CodeIgniter.php

    到了这里,终于进入CI框架的核心了.既然是“引导”文件,那么就是对用户的请求.参数等做相应的导向,让用户请求和数据流按照正确的线路各就各位.例如,用户的请求url: http://you.host.c ...

  8. CI框架源码阅读笔记3 全局函数Common.php

    从本篇开始,将深入CI框架的内部,一步步去探索这个框架的实现.结构和设计. Common.php文件定义了一系列的全局函数(一般来说,全局函数具有最高的加载优先权,因此大多数的框架中BootStrap ...

  9. CI框架源码阅读笔记1 - 环境准备、基本术语和框架流程

    最开始使用CI框架的时候,就打算写一个CI源码阅读的笔记系列,可惜虎头蛇尾,一直没有行动.最近项目少,总算是有了一些时间去写一些东西.于是准备将之前的一些笔记和经验记录下来,一方面权作备忘,另一方面时 ...

随机推荐

  1. [LintCode] Paint House 粉刷房子

    There are a row of n houses, each house can be painted with one of the three colors: red, blue or gr ...

  2. HTML静态网页 图片热点、框架、表单

    图片热点: 规划出图片上的一个区域,可以做出超链接,直接点击图片区域就可以完成跳转的效果. 示例: 网页划区: 在一个网页里,规划出一个区域用来展示另一个网页的内容. 示例: 框架: 1.frames ...

  3. js在输出时乱码

    如果网页头是<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> ...

  4. Xstream(对象和xml转换)

    package com.vcredit.framework.utils; import java.io.Writer; import org.apache.commons.lang3.StringUt ...

  5. Rails problem

    总是wa~ #include <stdio.h> int main() { ]; ], b[]; while(scanf("%d %s %s", &n, a, ...

  6. IOS彩票第一天基本框架搭建

    *****初始化 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionar ...

  7. FastDFS connect timed out

    java.net.SocketTimeoutException: connect timed outUpload file "1003.png"fails:connect time ...

  8. Postgres-enum

    -- 1. rename the enum type you want to change alter type some_enum_type rename to _some_enum_type; - ...

  9. CentOS7安装配置redis-3.0.0

    一.安装必要包 yum install gcc 二.linux下安装 #下载 wget http://download.redis.io/releases/redis-3.0.0.tar.gz tar ...

  10. 关于asp.net与jquery ajax 的一些补充

    补充1:asp.net 与后台交互除了用之前写得$.ajsx()外 还可以直接使用$.get()  , $.post()等. 补充2:jquery 跨域请求 例如: JSONP 跨域: $.ajax( ...