问题
I am trying to implement user login using PHP/Zend. Following the example below: https://github.com/ezimuel/Authentication-and-authorization-with-ZF.git
I get the following errors when going to http://localhost/
Warning: include_once(Login/Plugin/SecurityCheck.php) [function.include-once]: failed to open stream: No such file or directory in /Library/WebServer/Documents/xxxxx/library/Zend/Loader.php on line 146
Warning: include_once() [function.include]: Failed opening 'Login/Plugin/SecurityCheck.php' for inclusion (include_path='/Library/WebServer/Documents/xxxxx/application/../library:/Library/WebServer/Documents/xxxxx/library:/Library/WebServer/Documents/xxxxx/application/modules/login/library:.:/usr/lib/php') in /Library/WebServer/Documents/xxxxx/library/Zend/Loader.php on line 146
Fatal error: Class 'Login_Plugin_SecurityCheck' not found in /Library/WebServer/Documents/xxxxx/library/Zend/Application/Resource/Frontcontroller.php on line 117
I setup the project by following the Zend Quickstart Tutorials, so my application.ini file is slightly different. Im guessing this is a simple case of the application not being able to find certain files?
回答1:
Have you got these lines in your application.ini:
resources.frontController.defaultModule = "login"
resources.frontController.params.prefixDefaultModule = "1"
resources.modules[]=
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.plugins[] = "Login_Plugin_SecurityCheck"
Also, I notice the plugin is specified in the config as Login_Plugin_SecurityCheck, but in the login module, the folder is plugins, not plugin.
来源:https://stackoverflow.com/questions/7176301/fatal-error-login-plugin-securitycheck-not-found