Error: Class 'SimplePasswordHasher' not found
2014-04-18 11:25
453 查看
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.
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.
相关文章推荐
- Jboss Error :ConfigureListener ClassNotFoundException
- Getting error message “java.lang.ClassNotFoundException: javax.mail.internet.MimeMessage” while executing ant mail task
- Fatal error: Class 'PEAR_Error' not found in
- Eclipse Debugging Error: ClassNotFoundException的解决方法(很有用)
- WebService runtime modeler error: Wrapper class XXX is not found. Have you run APT to generate them?
- Internal Error (classFileParser.cpp:3161), pid=3412, tid=140710895388416 Error: ShouldNotReachHer
- FAQ(11):Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot
- hadoop 2.2.0 编译报错: [ERROR] class file for org.mortbay.component.AbstractLifeCycle not found
- ClassNotFound/load XXXX error 的疑问杂症
- Error configuring application listener of class XXX ClassNotFoundException
- MAVEN Error: java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream
- Fengoffice installation with fatal error "Class 'DB' not found"
- php使用ZipArchive提示Fatal error: Class ZipArchive not found in的解决方法
- MySql JDBC in eclipse "The driver class was not found in the specified driver JAR/Zip file." error
- ERROR] 19:04:48 [default] - Servlet.service() for servlet default threw exception java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Hex
- Classnotfoundexception 与 noClassDelfaultError的区别
- 解决Error:java: System Java Compiler was not found in classpath
- Symfony Fatal error: Class ‘YourClasseBundle’ not found in AppKernel.php
- ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0) java.lang.ClassNotFoundException: main.s
- 命令行执行php出现PHP Fatal error: Class ‘Redis’ not found in 错误