安装没有 apache 虚拟主机的 Zend 框架 [英] install zend framework without apache virtual hosts

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

问题描述

我的网站位于/var/www/invent.我在/var/www/invent/library 中有 zend 框架.

I have my website in /var/www/invent. I have zend-framework in /var/www/invent/library.

基本上我想要的是当我访问 http://localhost/invent 就像我有一个虚拟主机一样工作时在 apache conf 文件中定义的发明"(如访问 http://invent).我怎样才能做到这一点?我已经在 Windows 下开发了我的项目,设置了虚拟主机,但我不想继续这样工作,因为我无法在不允许我创建虚拟主机的公共虚拟主机服务上部署我的应用程序.更不用说如果我在局域网上部署一个应用程序,我还需要配置客户端的主机文件......请帮忙,这是 Zend 最烦人的事情(虽然到目前为止还没有尝试过其他框架).

Basically what i want is when i access http://localhost/invent to work as if i had a virtual host "invent" defined in apache conf file (like accessing http://invent). How can I achieve this? I have developed my project under windows, having virtual hosts set up but I don't want to continue working like this because i cannot deploy my app on public webhosting services that do not allow me to create virtual hosts. Not to mention that if I deploy an app on a LAN, i need to configure the client's hosts file as well... Please help, this is the most annoying thing with zend (haven't tried other frameworks so far though).

推荐答案

您的应用程序文档根目录是您放置 index.php 文件的任何位置,Zend Framework 库的位置和您的应用程序代码位于无关紧要.

Your application document root is wherever you place your index.php file, the locations of the Zend Framework library and your application code are irrelevant.

前提是您已经使用了 BaseUrl 静态资产(JavaScript、CSS、图像)视图中的帮助程序和操作链接的 Url 帮助程序,您的应用程序在相对于 Web 服务器文档根目录的相对路径方面应该是非常可移植的.

Provided you've used the BaseUrl helper in your views for static assets (JavaScript, CSS, images) and the Url helper for action links, your application should be very portable in regards to relative path from the web server document root.

如果我在这里偏离轨道,请告诉我.您的问题可以提供更多细节.

Let me know if I'm way off track here. Your question could do with some more details.

这篇关于安装没有 apache 虚拟主机的 Zend 框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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