2015-09-09 10 views
-1

通過Codeigniter 2.1.3重新安裝tank_auth庫。

當我嘗試訪問「http://localhost/es/auth/register」得到下面的PHP錯誤:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Auth::$db

Filename: libraries/Session.php

Line Number: 201

一切似乎進行配置和「自動加載」。

編輯:'/application/config/autoload.php'文件包含以下行:

$autoload['packages'] = array(); 
$autoload['libraries'] = array('database', 'session', 'xmlrpc','encrypt'); 
$autoload['helper'] = array('url', 'file'); 
$autoload['config'] = array(); 
$autoload['language'] = array(); 
$autoload['model'] = array(); 

可能是什麼問題?

+0

您必須先加載db庫。在 autoload.php: '$ autoload ['libraries'] = array('database');' –

+0

感謝Keval,但它已經加載... –

+0

檢查這可能會幫助你https:// github。 com/benedmunds/CodeIgniter-Ion-Auth/commit/644dd101a11207a042cf03b02885847caf99f0ff –

回答

1

怎麼樣改變數組元素的順序?只是儘量把之前「數據庫」「會話」,這可能是一個愚蠢的變化 - 因爲笨樣品就像你有的一個 - 但它是唯一的區別我可以用我的環境看:

$autoload['libraries'] = array('session', 'database'); 
$autoload['helper'] = array('array', 'url', 'form', 'string', 'date', 'language', 'static', 'cookie'); 

如果不工作,你可以嘗試在代碼中手動加載數據庫,正好看到任何線索:

$this->load->database(); 

啊,看一看你的數據庫的設置將確定在配置文件:

$config['hostname'] = "localhost"; 
$config['username'] = "myusername"; 
$config['password'] = "mypassword"; 
$config['database'] = "mydatabase"; 
$config['dbdriver'] = "mysql"; 

留意你的日誌配置太:

$config['log_threshold'] = 4; 

也許相關的一些問題pconnect?嘗試使用FALSE值。對不起,如果它沒有太大的幫助,這是我想到的唯一的東西。