CodeIgniter:配置文件ion_auth.php不存在


CodeIgniter: The configuration file ion_auth.php does not exist.

我一直在使用我的项目中使用的模块是用CodeIgniter编写的。

我有什么

Folders
-->application
  -->cache
  -->config
     -->config.php (configuration file for auth, I copied the codes to config.php)
  -->controllers
  -->core
  -->errors
  -->helpers
  -->hooks
  -->language
  -->libraries
     -->auth's libraries files.
  -->logs
  -->models
  -->modules
     -->admin
        -->controllers
           -->auth.php
        -->models
           -->ion_auth_model.php
        -->views
           -->auth
               -->login.php
     -->home
  -->third_party
  -->views
-->assets
-->system

问题出在哪里

当我转到localhost/home/auth/login.php时,会出现一条错误消息。屏幕上写着

遇到错误

配置文件ion_auth.php不存在。

我想问题是关于iounauth配置文件将在安装之前移动到配置文件夹。我没有把它移到配置文件夹。相反,我将该文件中的所有代码复制到config.php

那么我该如何解决这个问题呢?我需要看到登录屏幕,而不是这个错误消息。我想我应该更改controller文件夹中auth.php上的一些行。因为我在config文件夹中使用config.php而不是ionauth.php。

我刚刚对ion_auth库和模型进行了快速扫描,最简单的方法是:

  1. 从库和模型中删除$this->load->config('ion_auth', TRUE);

  2. 在库和模型中进行字符串替换:

查找:, 'ion_auth')替换为:)

我已经对文件进行了快速扫描,我看不出有什么地方会破坏任何东西,但在做的时候要小心(也许一次做一个)。

以上步骤应允许您在config.php 中使用_auth配置项

请注意,我还没有对此进行测试。

希望这能有所帮助!

当我将web移动到linux服务器时,我也面临着这个问题,通过将config/Ion_auth.php重命名为config/Ion_auth.php

解决了这个问题