Warning: require_once(../models/Message.php) [function.require-once]: failed to open stream: No such file or directory in F:\xampp\htdocs\zendfrm\application\controllers\IndexController.php on line 2 | ||||
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0029 | 340224 | {main}( ) | ..\index.php:0 |
2 | 0.0390 | 2197240 | Zend_Application->run( ) | ..\index.php:26 |
3 | 0.0390 | 2197240 | Zend_Application_Bootstrap_Bootstrap->run( ) | ..\Application.php:366 |
4 | 0.0391 | 2197296 | Zend_Controller_Front->dispatch( ???, ??? ) | ..\Bootstrap.php:97 |
5 | 0.0509 | 3507920 | Zend_Controller_Dispatcher_Standard->dispatch( object(Zend_Controller_Request_Http)[14],object(Zend_Controller_Response_Http)[15] | ..\Front.php:954 |
6 | 0.0515 | 3507976 | Zend_Controller_Dispatcher_Standard->loadClass( string(15) | ..\Standard.php:262 |
7 | 0.0526 | 3526248 | include_once( 'F:\xampp\htdocs\zendfrm\application\controllers\IndexController.php' | ..\Standard.php:344 |
( ! ) Fatal error: require_once() [function.require]: Failed opening required '../models/Message.php' (include_path='F:\xampp\htdocs\zendfrm\application/../library;F:\xampp\htdocs\zendfrm\library;.;F:\xampp\php\PEAR') in F:\xampp\htdocs\zendfrm\application\controllers\IndexController.php on line 2 | ||||
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0029 | 340224 | {main}( ) | ..\index.php:0 |
2 | 0.0390 | 2197240 | Zend_Application->run( ) | ..\index.php:26 |
3 | 0.0390 | 2197240 | Zend_Application_Bootstrap_Bootstrap->run( ) | ..\Application.php:366 |
4 | 0.0391 | 2197296 | Zend_Controller_Front->dispatch( ???, ??? ) | ..\Bootstrap.php:97 |
5 | 0.0509 | 3507920 | Zend_Controller_Dispatcher_Standard->dispatch( object(Zend_Controller_Request_Http)[14],object(Zend_Controller_Response_Http)[15] | ..\Front.php:954 |
6 | 0.0515 | 3507976 | Zend_Controller_Dispatcher_Standard->loadClass( string(15) | ..\Standard.php:262 |
7 | 0.0526 | 3526248 | include_once( 'F:\xampp\htdocs\zendfrm\application\controllers\IndexController.php' | ..\Standard.php:344 |
直接用require_once '../models/Message.php'; 报错
//此方法能解决路径不对的错误
方法1 require_once dirname(dirname(__FILE__)).'/models/Message.php';
方法2 require_once APPLICATION_PATH.'/models/Message.php';
原因如下: