windows 在 Xampp 之后安装 Zend 框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6497257/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 17:13:10  来源:igfitidea点击:

Installing Zend Framework After Xampp

windowszend-frameworkxampp

提问by Anonymous

I am running Windows 7 and am using Xampp. I would like to install the Zend framework for PHP, but I am having difficulties understanding how to install it. I have used the Zend framework before, but it was already installed on the Linux system I was working on.

我正在运行 Windows 7 并且正在使用 Xampp。我想为 PHP 安装 Zend 框架,但我无法理解如何安装它。我之前使用过 Zend 框架,但它已经安装在我正在使用的 Linux 系统上。

I am reading through the Zend documentation here: http://framework.zend.com/manual/en/learning.quickstart.create-project.html

我正在阅读 Zend 文档:http: //framework.zend.com/manual/en/learning.quickstart.create-project.html

I am having trouble with updating the includes_path portion. My original include path was include_path = ".;C:\xampp\php\PEAR", but I updated it to include_path = ".;C:\Zend".

我在更新 contains_path 部分时遇到问题。我的原始包含路径是include_path = ".;C:\xampp\php\PEAR",但我将其更新为include_path = ".;C:\Zend".

I then followed the directions for creating a new project by opening the command line tool and running % C:\Zend\bin\zf.sh create project testprojectin the desired directory. I get the following error message: '%' is not recognized as an internal or external command, or a batch file.

然后,我按照创建新项目的说明打​​开命令行工具并% C:\Zend\bin\zf.sh create project testproject在所需目录中运行。我收到以下错误消息:'%' is not recognized as an internal or external command, or a batch file.

Some help with this would be greatly appreciated.

对此的一些帮助将不胜感激。

回答by venimus

C:\Zend\bin\zf.shis for linux, you need C:\Zend\bin\zf.batI dont even know how you could run it

C:\Zend\bin\zf.sh适用于 linux,您需要C:\Zend\bin\zf.bat我什至不知道如何运行它

To setup ZF you just need to add C:\Zend\libraryin your include_path

要设置ZF,你只需要添加C:\Zend\library在你的include_path

To fix PHP not foundyou need to add ;C:\xampp\php\to the environment variable "Path" from

要修复未找到的 PHP,您需要添加;C:\xampp\php\到环境变量“Path”中

Click Start, Right Click on Computerthen click Properties

单击Start,右键单击,Computer然后单击Properties

Then Advanced System settings>Advanced Tab/Environment Variables>System variables>Path/Edit...

然后高级系统设置>高级选项卡/环境变量>系统变量>路径/编辑...

enter image description here

在此处输入图片说明

Then append to the end ;C:\xampp\php

然后追加到最后 ;C:\xampp\php

You should also append ;C:\Zend\binfor easy access to zf.bat[2]

您还应该附加;C:\Zend\bin以便轻松访问zf.bat[2]

Then to create project do not use cd C:\Zend\bin!! because your project will be created into that directory. Use the full path C:\Zend\bin\zf create project quickstart

然后创建项目不要使用cd C:\Zend\bin!因为您的项目将创建到该目录中。使用完整路径C:\Zend\bin\zf create project quickstart

or if you did step [2], simply go to your htdocs(with cd your_htdocs_path) or whatever you set in apache for web root and execute zf create projext quickstart

或者,如果您执行了步骤 [2],只需转到您的htdocs(with cd your_htdocs_path) 或您在 apache 中为 web root 设置的任何内容并执行zf create projext quickstart

you also might need to setup a virtual host "quickstart" in apache and probably new line in windows hostsfile: 127.0.0.1 quickstartbecause ZF is designed mainly for virtual hosts

您可能还需要在 apache 中设置一个虚拟主机“快速入门”,并且可能需要在 windowshosts文件中设置新行 :127.0.0.1 quickstart因为 ZF 主要是为虚拟主机设计的

回答by Arun

You can also go to your zendFrame work where you have extracted it and then go to bin folder (in my case “C:\xampp\htdocs\ZendFramework\bin”) where you can find zf.bat . Edit it with any editer and go to

你也可以转到你解压的 zendFrame 作品,然后转到 bin 文件夹(在我的例子中是“C:\xampp\htdocs\ZendFramework\bin”),在那里你可以找到 zf.bat 。使用任何编辑器编辑它并转到

“SET PHP_BIN=php.exe ”

and set it to

并将其设置为

“SET PHP_BIN=C:\xampp\php\php.exe”

and it worked for me…

它对我有用……

回答by aporat

you can install the zend framework using PEAR

您可以使用 PEAR 安装 zend 框架

pear channel-discover zend.googlecode.com/svn
pear install zend/zend

If you don't know where is your PEAR executable, run a file search for "pear", or "pear.exe".

如果您不知道 PEAR 可执行文件在哪里,请运行文件搜索“pear”或“pear.exe”。

After that, check out the section called "Setting up the CLI tool on Windows" in http://framework.zend.com/manual/en/zend.tool.framework.clitool.html. It will help you set up a easy access to the zf command line tool.

之后,查看http://framework.zend.com/manual/en/zend.tool.framework.clitool.html 中名为“在 Windows 上设置 CLI 工具”的部分。它将帮助您设置对 zf 命令行工具的轻松访问。

回答by RobertPitt

Look's like your trying to run a shell script on cmd, not going to work, try this:

看起来像你试图在 cmd 上运行一个 shell 脚本,不工作,试试这个:

Start>Run>cmd[enter]

开始>运行> cmd[回车]

> cd  C:\path\to\html\docs
> C:\Zend\bin\zf create project quickstart

and do not place the >marker, just the cd ..and zf ..

并且不要放置>标记,只放置cd ..zf ..

回答by richie

Add the path to the php interpreter to the %PATH% environment variable: control panel => system => Advanced system settings => Environment Variables... => System Variables => => append ;C:\xampp\php

将 php 解释器的路径添加到 %PATH% 环境变量中:控制面板 => 系统 => 高级系统设置 => 环境变量... => 系统变量 => => 追加 ;C:\xampp\php