简体   繁体   English

有关Zend Framework的重定向或文件访问问题

[英]A redirection or file access problem about Zend Framework

I'm beginner at Zend Framework. 我是Zend Framework的初学者。 I have a php project with Zend 2.2.0 and PHP 5.2.4 but it cannot work truely.For ex at the staring point; 我有一个Zend 2.2.0和PHP 5.2.4的php项目,但是它不能真正工作。

Failed opening required 'Zend_Loader_Autoloader.php' but this php file is exist. 无法打开所需的'Zend_Loader_Autoloader.php',但是此php文件存在。

And maybe a helper point about solving problem, when I try to access a file in our project like http://localhost/application/default/views/scripts/login/index.phtml the file opens but there is no access javascript file like default_login.js.(and a similar situation about *.gif files etc.) 当我尝试访问我们项目中的文件(例如http://localhost/application/default/views/scripts/login/index.phtml)时,也许可以找到解决问题的帮手点,但文件无法打开,但无法访问default_login.js(以及有关* .gif文件的类似情况等)

Firebug prints: "http://localhost/application/default/views/scripts/login/%7B$VIRTUAL_DIR%7Dpublic/scripts/default_login.js" 404 not found. Firebug打印:“ http://localhost/application/default/views/scripts/login/%7B$VIRTUAL_DIR%7Dpublic/scripts/default_login.js” 404未找到。

However the correct url must be "http://localhost/public/scripts/default_login.js" 但是,正确的网址必须是“ http://localhost/public/scripts/default_login.js”

NOTE:The directory access permissions are ok, the problem is not that. 注意:目录访问权限还可以,问题不在于此。

If Zend_Loader_Autoloader is not found then I suspect the Zend Framework library is not in the include path or inaccessible (permissions). 如果未找到Zend_Loader_Autoloader,则我怀疑Zend Framework库不在包含路径中或不可访问(权限)。 Also the 404 on .js and .gif files maybe down to your ModRewrite rules, have you changed the default .htaccess file at all? 此外,.js和.gif文件上的404可能取决于您的ModRewrite规则,您是否更改了默认的.htaccess文件?

edit : Pretty sure this is going to end up be not including the ZF library in the includes path. 编辑:可以肯定的是,这最终将不会在包含路径中包含ZF库。 To check the include path use phpinfo() or just have a look at what is set in /public/index.php It defaults to 要检查包含路径,请使用phpinfo()或只看一下/public/index.php中的设置。默认为

set_include_path(implode(PATH_SEPARATOR, array(
  realpath(APPLICATION_PATH . '/../library'),
  get_include_path(),
)));

I don't have my copy there as I installed using PEAR and it's already in my includes path 我使用PEAR安装时没有副本,它已经在我的包含路径中

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

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