当我无法更改文档根目录时,应该如何设置我的应用程序?
我无权更改 /public/ 目录下的文档根目录,那么我应该如何设置我的 Zend Framework 应用程序以从当前根目录运行? 使用Zend Framework 1.8命令行工具,我不知道是否有办法告诉它以这种方式创建目录结构。
I don't have permission to change the document root the /public/ directory so how should I set up my Zend Framework application to run from the current root directory? Using the Zend Framework 1.8 command line tool, I don't know if there is a way to tell it to create a directory structure this way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您只能访问网络的上层(即公共),您应该在那里设置索引以及整个应用程序文件夹。 创建一个 .htaccess
所有人都否认
并将其放入您的/应用程序中。
您的配置将是:
If you can access only the upper level of web (i.e. - public), you should set index there and the whole application folder too. Create a .htaccess with
Deny from all
And put it into your /application.
Your configuration will be:
最简单的方法,无需更改大量配置,是将您提到的
public
文件夹中的所有内容放入public_html
文件夹中,然后放置所有其他内容,例如应用程序,和库文件夹放入public_html
上方的目录中。您还可以将所有内容放入
public_html
文件夹中,但不建议这样做。 每个类都可以选择提供不同的路径。 例如,在 Front_Controller 上,您可以将 Controllers 目录设置到您想要的任何位置。 有一些选项可以指定不同的路径,但如果您遵循约定,它就会为您完成。The simplest way without changing a lot of configuration, is to put everything in the
public
folder you mention into yourpublic_html
folder, then place all the other contents, like the application, and library folders into the directory up frompublic_html
.You can also throw everything into your
public_html
folder, although that is not recommended. Each class has options to provide a different path. For example on the Front_Controller, you can set the Controllers directory to wherever you want. There are options to specify different paths, but if you follow convention it is done for you.只需使用快速入门指南并根据它进行调整。 无论如何,Zend_Tool 仍处于实验阶段。 让我知道这是否有帮助。
Just use the quickstart guide and adjust according to it. Zend_Tool is still experimental anyway. Let me know if this helps.
这就是我最终所做的:
然而,我认为这并不理想,正如已经提到的,应用程序目录可以从网络访问,但现在,它已经完成了工作。
So here's what I ended up doing:
I don't think this is ideal however, as already mentioned, application directory becomes accessible from the web, but for now, it's getting the job done.