是的,我想你正在考虑说这个问题可能是重复的,但不是因为类似问题的答案并没有解决我目前遇到的问题.
原文链接:https://www.f2er.com/php/136545.html我在自动加载名为’PHPass’的库时收到以下错误,如下所示.
An Error Was Encountered
Unable to load the requested class: PHPass
$autoload['libraries'] = array('database','PHPass');
PHPass.PHP文件驻留在application / libraries文件夹中,并且该类被声明为类PHPass,这意味着该问题无法与大写或文件路径相关,正如我遇到的大多数其他答案中所建议的那样.
请你告诉我我错过了什么?它在MAMP中运行良好,但是,当上传到我的Linux ubuntu服务器(Apache2)时,它会停止工作.
谢谢,
最大.
编辑— 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); }