我的项目中有这个问题,我不知道我还能做些什么来解决它。
在我的本地主机环境中,它工作得很好,但是当我将它发送到服务器时,只需停止使用这个警告+致命错误消息即可。
Warning: include_once(model/Login.php): failed to open stream:
No such file or directory in /var/www/ecommerce/include_path/Zend/Loader.php on line 134 Warning: include_once():
Failed opening 'model/Login.php' for inclusion
(include_path='/var/www/wdna.com.br/admin2/application/../library::/var/www/wdna.com.br/admin2/library:
/var/www/wdna.com.br/admin2/application/modules.:/usr/share/php:/var/www/ecommerce/include_path') in /var/www/ecommerce/include_path/Zend/Loader.php on line 134
Fatal error: Class 'model_Login' not found in /var/www/wdna.com.br/admin2/application/modules/default/controllers/LoginController.php on line 15
我的文件夹结构是这样的:
+---application
| \---modules
| \---default
| +---models
登录控制器.php:
15 $login = new default_models_Login();
16 $login = $login->login($this->_getParam('login'), $this->_getParam('senha'));
我的函数_initAutoloader:
protected function _initAutoloader(){
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('App');
}
新错误:
警告:include_once(默认/Models/Login.php):无法打开流:第 134 行 /var/www/ecommerce/include_path/Zend/Loader.php 中没有此类文件或目录警告:include_once():打开失败' Default/Models/Login.php' 用于包含(include_path='/var/www/wdna.com.br/admin2/application/../library::/var/www/wdna.com.br/admin2/library: /var/www/wdna.com.br/admin2/application/modules.:/usr/share/php:/var/www/ecommerce/include_path') 在 /var/www/ecommerce/include_path/Zend/Loader.php在第 134 行致命错误:在第 15 行的 /var/www/wdna.com.br/admin2/application/modules/default/controllers/LoginController.php 中找不到类“Default_Models_Login”
任何帮助都感激不尽。