Error: Class 'SimplePasswordHasher' not found
来源:互联网 发布:搭建视频解析接口源码 编辑:程序博客网 时间:2024/06/03 01:42
PHP新手,在跟着the guide of cakephp(http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html)做练习时,访问这个/cakephp/users/add url时出现这个错误:
Error: Class 'SimplePasswordHasher' not found
自己猜测应该是没有导入这个类,按照App::uses('AppModel', 'Model');这样添加,我写成:
App::uses('SimplePasswordHasher', 'SimplePasswordHasher');
结果还是错的,在Google上搜索了一下,发现应该是这样添加:
App::uses('SimplePasswordHasher', 'Controller/Component/Auth');
参考的文章:
http://cakephp.1045679.n5.nabble.com/Error-Class-SimplePasswordHasher-not-found-td5717231.html
Hi All,
I hope you can point me in the right direction.
I'm following the guide at: http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html
I'm using CakePHP 2.4.3 and have followed the guide to the letter of the law. It mostly works correctly. If I try to access a controller/action it redirects as it should to the users/login action... so that's seems fine.
The issue is when I try to add a new user at users/add. It throws this error: Error: Class 'SimplePasswordHasher' not found
I have made sure that the following is pasted in the top of the Users model: App::uses('AppModel', 'Model', 'SimplePasswordHasher', 'Controller/Component/Auth');
I then thought that perhaps this "SimplePasswordHasher" class was a new thing part of 2.4.4 so I set up another test project to test it and went through the entire Auth tutorial again with exactly the same results.
Where am I going wrong? It there some code missing?
I had exactly the same issue when I did the tutorial, but it had to do with caching/refreshing because suddenly it worked.
In your case: you do mean the 'User' model; it should not be 'Users'.
I only have 'App::uses('SimplePasswordHasher', 'Controller/Component/Auth');' and it works just fine.
0 0
- Error: Class 'SimplePasswordHasher' not found
- Class 'XSLTProcessor' not found Error解决方案
- Fatal error: Class 'PEAR_Error' not found in
- Fatal error: Class ‘ZipArchive’ not found
- PHP Fatal error: Class 'DOMDocument' not found
- Fatal error: Class 'PDO' not found解决办法
- PHP Fatal error: Class 'Mongo' not found
- ERROR:Class 'Log' not found thinkphp
- service archiver Error : Class not found
- Fatal error: Class 'Mobile_Detect' not found
- Andoid DigestUtils.md5Hed("") Class Not Found Error
- ubuntu - Fatal error: Class 'Redis' not found
- Fatal error: Class 'Mage_Adminhtml_Controller_action' not found in
- Workerman--Fatal error: Class 'MongoClient' not found
- PHP Fatal error: Class 'DOMDocument' not found
- Fatal error: Class 'GearmanClient' not found解决方法
- Fatal error: Class 'LearningPHP1\mysqli' not found
- 【Error】Class 'App\Role' not found
- perl中正则匹配 ("=!" "!~")
- linux下打开、关闭tomcat,实时查看tomcat运行日志
- 解决方法是修改Wordpress程序文件来实现
- 2012届华为编程大赛第一题
- 搜索相关参考文献
- Error: Class 'SimplePasswordHasher' not found
- 笑话
- 2014年,联想企业级准备这么做……
- Hadoop重新编译WordCount程序报错:cannot access Options
- C#GDI+ 处理文本的两个小技巧
- 一路美好,尽在途中
- Struts2的IoC解析
- 给一维数组赋值并按条件输出的问题
- JS 四则运算(加减乘除小数运算)避免损失精度