在 Windows 中的 XAMPP 上安装 Zend Framework 2 [英] Installing Zend Framework 2 on XAMPP in Windows

查看:31
本文介绍了在 Windows 中的 XAMPP 上安装 Zend Framework 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题可能在这里和互联网上出现过几次.但是我仍然觉得对于想要进入框架世界的人来说还不清楚.我遵循了这些链接 Rob Allens 教程ZF 快速教程.

但是我觉得安装部分不太清楚.我有一个 Windows 系统,基本上是 Vista,安装了最新版本的 XAMPP.我已经从这个链接 ZFSkeletonApp 下载了最新版本的 ZFSkeletonApplication,提取了骨架内容,将文件夹重命名为 zendframework 和将其移至 xampp 文件夹,即现在 ZF 骨架位于 c:\xampp\zendframework.

所以直到这里一切都变得清晰而简单,从这里我对配置失去了一些了解.有人可以从这里详细说明如何安装 Zf 并使其工作,例如更改包含路径、.htaccess 文件等.请记住,我有带有 XAMPP 的窗口.如果有人可以准确指导我进行此设置,那将很有帮助.

附言如果有人可以提供有关我需要使用由路径组成的示例进行的更改的信息,这样我就不会迷路,例如您可以在这里找到 .htaccess 文件(ex pathname),更改 .htaccess 文件,那就太好了应该是这样的.

谢谢

解决方案

为了以后的参考,我还写了一篇关于如何在 windows xampp 环境中安装 ZF2 的重要帖子 在 Windows Xampp 上安装 ZF2

好的,我现在已经在多个系统上完成了这项工作.对于家庭系统,以下步骤非常有效:

  • 下载msysGit并安装到任意目录
  • 从 msysGit 文件夹运行 git-cmd.bat
  • 移动到你想要的目录,即 C:\xampp\htdocs\(这是通过 cd dirnamecd .. 完成的上一级,使用 D: 更改分区并按 Enter)

运行以下命令. 将是 htdocs 的子目录的名称,如果您跳过它,该文件夹将被命名为 ZendSkeletonApplication

git clone git://github.com/zendframework/ZendSkeletonApplication.git 

可能的问题场景(致命:无法连接到 github.com)

再一次在工作场所,git 协议的默认端口 (9418) 经常被阻止.如果您是这种情况,那么您应该尝试以下命令之一

git clone https://github.com/zendframework/ZendSkeletonApplication.git git clone git@github.com:zendframework/ZendSkeletonApplication.git 

现在你还没有完成.骨架应用程序安装好了,但是框架还没有,这里有些人可能会遇到第一个问题,但这实际上很容易.

我们仍然在命令行界面

  • cd cd ZendSkeletonApplication 取决于你之前做了什么
  • php composer.phar 自我更新
  • php composer.phar install(这可能需要一段时间)

所以,这是可能发生很多事情的部分.我有两种情况发生在我身上:

场景 #1 没有目录写入权限

这很容易通过以管理员权限运行命令行界面来处理

场景 #2 在路由器后面工作(即在工作中)

就我个人而言,我不需要做太多事情来让它工作,但线路可能会根据您的代理而改变.我个人在命令行界面做了以下操作

  • SET HTTP_PROXY=http://proxy.domain.tld:8080 你可能也很擅长
  • SET HTTP_PROXY=proxy.domain.tld:8080 不要问我为什么,但我需要 http://

完成所有这些后,您应该有一个几乎可以运行的 ZendSkeletonApplication.另一部分是如何设置您的虚拟主机,但我不会详细介绍这一点,因为即使是 ZF1 Stuff,现在每个人都应该熟悉它,如果没有,还有 很好的学习资源.>

希望能帮到你.

I know this question may have appeared few times here and in the internet. But still I feel it is not clear for somebody who wanted to enter into the world of frameworks. I have followed these links Rob Allens Tutorial, ZF Quick Tutorial.

But some how I feel it is not quite clear with the installation part. I have a windows system basically Vista with the newest version of XAMPP installed. I have downloaded the latest version of ZFSkeletonApplication from this link ZFSkeletonApp, extracted the skeleton contents, renamed the folder to zendframework and moved it to xampp folder i.e now ZF skeleton is in c:\xampp\zendframework.

So until here everything seems clear and easy, from here I am some how lost with the configurations. Can some one elaborate the things from here how to install the Zf and make it work, like changes in the include paths, .htaccess files and so on. Please do remember that I have windows with XAMPP on it. If some one can guide me exactly for this set up, it would be helpful.

P.S. It would be good if one can provide info about the changes which I need to make with examples consisting of paths, so that I am not lost, for example like you can find .htaccess file here(ex pathname), changes in .htaccess file should be so and so.

Thanks

解决方案

For future references, i also made a big post on how to install ZF2 on a windows xampp environment right here Install ZF2 on Windows Xampp

OK, i have done this on multiple systems now. For a home system the following steps work quite well:

  • Download msysGit and install it to any directory
  • Run the git-cmd.bat from the msysGit-Folder
  • Move into the directory you want i.e. C:\xampp\htdocs\ (this is done via cd dirname or cd .. to go up a level, change partition with D: and hit enter)

Run the following command. The <OptionalFolderName> would be the name of a Sub-Directory of htdocs, if you skip this, the folder will get named ZendSkeletonApplication

git clone git://github.com/zendframework/ZendSkeletonApplication.git <OptionalFolderName>

Possible Trouble Scenario (fatal:unable to connect to github.com)

Once again at workplaces, pretty often the default port (9418) for the git-protocol is blocked. If this is the case for you, then you should try one of the following Commands

git clone https://github.com/zendframework/ZendSkeletonApplication.git <OptionalFolderName>
git clone git@github.com:zendframework/ZendSkeletonApplication.git <OptionalFolderName>

Now you are not done yet. The skeleton Application is installed, but the framework is still missing, here some people might run into the first problems, but this actually is quite easy.

We're still at the command line interface

  • cd <OptionalFolderName> or cd ZendSkeletonApplication depending on what you did earlier
  • php composer.phar self-update
  • php composer.phar install (this might take a while)

So, this is the part where lots of things can happen. I have two scenarios happened to me:

Scenario #1 No directory write permissions

This is easily handled by running the command line interface with administrator privileges

Scenario #2 Working behind a router (i.e. at work)

Personally i didn't have to do much to get this working, but the line might change depending on your proxy. Personally i did the following at the command line interface

  • SET HTTP_PROXY=http://proxy.domain.tld:8080 you might also be good with
  • SET HTTP_PROXY=proxy.domain.tld:8080 don't ask me why, but i needed the http://

With all those done, you should have an almost running ZendSkeletonApplication. The other part is how to set up your virtual host, but i won't go into detail on this, as that's even ZF1 Stuff and everyone should be familiar with that by now, if not, there's good resources to learn out there.

I hope i could be of help to you.

这篇关于在 Windows 中的 XAMPP 上安装 Zend Framework 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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