zoukankan      html  css  js  c++  java
  • 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.6systemcoreConfig.php 构造函数体内  $_SERVER['SERVER_ADDR']  造成,改成 $_SERVER['HTTP_HOST'],做相应调整亦可。

  • 相关阅读:
    Mybatis 与 spring mvc
    Extjs 表格横坐标显示问题
    Extjs 图片的自动缩放
    C# Winform 界面中各控件随着窗口大小变化
    spring 连接各种数据源的配置(转载)
    <转>(C#)WinForm窗体间传值
    java stack 底层详细
    java hashmap 底层详细
    java LinkedList 底层详细
    java ArrayList 底层详细
  • 原文地址:https://www.cnblogs.com/c-961900940/p/5972753.html
Copyright © 2011-2022 走看看