Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何绕过codeigniter安全直接访问项目_Php_Codeigniter - Fatal编程技术网

Php 如何绕过codeigniter安全直接访问项目

Php 如何绕过codeigniter安全直接访问项目,php,codeigniter,Php,Codeigniter,我想访问该项目,但它要求安装像基本配置,但我想删除它的框架是codeigniter index.php代码…如下 define('ENVIRONMENT', 'pre_installation'); // we don't want to access the main project before installation. redirect to installation page if (ENVIRONMENT === 'pre_installation') { $domain

我想访问该项目,但它要求安装像基本配置,但我想删除它的框架是codeigniter

index.php代码…如下

define('ENVIRONMENT', 'pre_installation');

// we don't want to access the main project before installation. redirect to installation page
if (ENVIRONMENT === 'pre_installation') {
    $domain = $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];

    $domain = preg_replace('/index.php.*/', '', $domain); //remove everything after index.php
    if (!empty($_SERVER['HTTPS'])) {
        $domain = 'https://' . $domain;
    } else {
        $domain = 'http://' . $domain;
    }

    header("Location: $domain./install/index.php");
    exit;
}
.htaccess文件代码

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

#Cache
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
重新编写引擎打开
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L]
#缓存
标题集缓存控制“最大年龄=2592000,公共”

但我想直接访问控制器及其功能,但它一直将我重定向回安装页面

安装页面即将到来,因为您的CI
环境
变量已设置为安装前
因此,将
环境
更改为
生产
开发


像这样:
定义('ENVIRONMENT','development')
定义(“环境”、“生产”)

您可能只需浏览CodeIgniter向导即可正确安装基础知识。您无法确定在安装之前是否配置了任何东西,因为这是安装的全部要点

如果你真的想通过艰苦的方式学习,那么正如pGauR所说,你可以改变
环境
定义。这将运行代码,直到遇到下一个错误

define('ENVIRONMENT', 'development');