10

はい、この質問は重複の可能性があると考えていると思いますが、同様の質問に対する回答が現在抱えている問題を解決していないため、そうではありません。

次のように「phpass」という名前のライブラリをオートロードしているときに、次のエラーが表示されます。

エラーが発生しました要求されたクラスをロードできません: Phpass

ライブラリを自動ロードするコード

$autoload['libraries'] = array('database', 'phpass');

phpass.php ファイルは application/libraries フォルダーにあり、クラスは、class phpass私が遭遇した他の回答の大部分で示唆されているように、問題が大文字化やファイル パスに関連していないことを意味するものとして宣言されています。

私が欠けているものを教えてください。MAMP では完全に動作しますが、Linux Ubuntu サーバー (Apache2) にアップロードすると動作しなくなります。

ありがとう、

最大。

Edit--- Utku から要求されたコンストラクター メソッド

class phpass {

    protected $PasswordHash;

    // default values if config was not found
    protected $iteration_count_log2 = 8;
    protected $portable_hashes = FALSE;

    /**
     * Construct with configuration array
     * 
     * @param array $config
     */
    public function __construct($config = array()) {
        // check if the original phpass file exists
        if (!file_exists($path = dirname(__FILE__) . '/../vendor/PasswordHash.php')) {
            show_error('The phpass class file was not found.');
        }

        include ($path);

        if (!empty($config)) {
            $this->initialize($config);
        }

        // create phpass object
        $this->PasswordHash = new PasswordHash($this->iteration_count_log2, $this->portable_hashes);
    }
4

1 に答える 1