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'],做相应调整亦可。

  • 相关阅读:
    CF1442E. Black, White and Grey Tree
    CF1442D. Sum
    CF1444D. Rectangular Polyline
    arc107F
    外心与垂心关系
    CF1434E. A Convex Game
    CF1434D. Roads and Ramen
    arc106E
    arc106F
    CF704E. Iron Man
  • 原文地址:https://www.cnblogs.com/c-961900940/p/5972753.html
Copyright © 2011-2022 走看看