Zend 框架路径问题 [英] Zend Framework Path Problems

查看:42
本文介绍了Zend 框架路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部,

我只是想查看除欢迎使用 Zend Framework"屏幕之外的任何页面.

I am just trying to view any page at all besides the "Welcome to Zend Framework" screen.

我已经从本教程下载了项目:http://framework.zend.com/docs/quickstart/create-a-表格(Zend 框架快速入门)

I have downloaded the project from this tutorial: http://framework.zend.com/docs/quickstart/create-a-form (Zend Framework Quickstart)

据我所知,路径正确.我读了这篇文章:http://www.johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/我认为它可能有点过时了,因为引导程序代码不像他描述的那样.

As far as I can tell, the paths are coming up correctly. I read this post: http://www.johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/ I think it may be a bit dated, as the bootstrap code is not as he describes.

有人有什么想法吗?我认为从 Zend 下载的教程应该是开箱即用的.

Does anyone have any ideas? I would think that the tutorial download from Zend should work out of the box.

总结:http://localhost/ZendFrameworkQuickstart/public/显示:Zend 欢迎页面

Summary: http://localhost/ZendFrameworkQuickstart/public/ Displays: Zend welcome page

http://localhost/ZendFrameworkQuickstart/public/guestbook显示:404

谢谢!

更新public"目录的物理路径:C:\Zend\Apache2\htdocs\ZendFrameworkQuickstart\public

UPDATE Physical path of the "public" directory: C:\Zend\Apache2\htdocs\ZendFrameworkQuickstart\public

我从浏览器点击的网址:http://localhost/ZendFrameworkQuickstart/public/guestbook

URL I’m hitting from the browser: http://localhost/ZendFrameworkQuickstart/public/guestbook

.htaccess 内容:

.htaccess Contents:

SetEnv APPLICATION_ENV 开发

SetEnv APPLICATION_ENV development

重写引擎开启

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME} -d

重写规则 ^.*$ - [NC,L]

RewriteRule ^.*$ - [NC,L]

重写规则 ^.*$/ZendFrameworkQuickstart/Public/index.php [NC,L]

RewriteRule ^.*$ /ZendFrameworkQuickstart/Public/index.php [NC,L]

更新:更改文件中的行

.htaccess重写规则 ^.*$/ZendFrameworkQuickstart/public/index.php [NC,L]

.htaccess RewriteRule ^.*$ /ZendFrameworkQuickstart/public/index.php [NC,L]

应用程序.iniresources.frontController.baseUrl = "/ZendFrameworkQuickstart/public"

application.ini resources.frontController.baseUrl = "/ZendFrameworkQuickstart/public"

公共/index.phperror_reporting( E_ALL | E_STRICT );ini_set('display_errors', 1);

public/index.php error_reporting( E_ALL | E_STRICT ); ini_set( 'display_errors', 1 );

推荐答案

终于想通了.在 Apache 的 httpd.conf 文件中,将AllowOverride None"的每个实例更改为AllowOverride All".

Finally figured it out. In the httpd.conf file for Apache, change every instance of "AllowOverride None" to "AllowOverride All."

我不知道为什么 Zend 没有这个设置,因为我的 Zend Framework 安装了 Apache.进行此更改后,快速入门按原样运行(甚至不需要在根目录中).

I'm not sure why Zend didn't have this setup already, since my Zend Framework install setup Apache. After this change, the Quickstart ran as-is (and didn't even need to be in the root).

感谢大家的帮助!

这篇关于Zend 框架路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆