Zend框架/快速入门:未定义的常量APPLICATION_PATH(Zend Framework/

2019-08-07 03:33发布

我得到了一个错误信息

Notice: Use of undefined constant APPLICATION_PATH - assumed 'APPLICATION_PATH' in C:\wamp\www\index.php on line 4

Notice: Use of undefined constant APPLICATION_PATH - assumed 'APPLICATION_PATH' in C:\wamp\www\index.php on line 5

当我把下面的代码中的index.php:

set_include_path(
    'C:\wamp\www\Zend\' . PATH_SEPARATOR .
    APPLICATION_PATH . '/../library' . PATH_SEPARATOR .
    APPLICATION_PATH . '/models' . 
    PATH_SEPARATOR . get_include_path() );

什么是这APPLICATION_PATH,应我写任何东西,而不是这个....

非常感谢

Answer 1:

回覆,

应用程序路径是您的Zend项目的应用程序目录

define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/'));

看到快速启动以供参考

欢呼



文章来源: Zend Framework/Quickstart: undefined constant APPLICATION_PATH