简体   繁体   English

定义路径

[英]defining a path

I am setting up a Zend environment and cannot get the past this error. 我正在设置Zend环境,无法解决此错误。

This is the code: 这是代码:

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

set_include_path(APPLICATION_PATH . '/../library/' 
                . PATH_SEPARATOR . get_include_path()
                );
echo APPLICATION_PATH;

require_once 'Zend/Loader.php';

This is the error: 这是错误:

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)'

At the very least, you are missing a slash before the ../application: 至少,您在../application之前缺少斜杠:

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

set_include_path(APPLICATION_PATH . '/../library/' . PATH_SEPARATOR . get_include_path() ); echo APPLICATION_PATH;

To provide more details, I think we'd need to know about the directory structure, where the index.php is, etc. 为了提供更多详细信息,我认为我们需要了解目录结构,index.php的位置等。

I was able to fix this problem on my own. 我能够自己解决此问题。 I realized that the controller folder was misspelled. 我意识到控制器文件夹拼写错误。 It looks like this error is usually caused when the appropriate file structure isn't there or if the controller file is misspelled. 当适当的文件结构不存在或控制器文件拼写错误时,通常会导致此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM