如何在Windows上安装Zend框架

时间:2022-09-24 00:25:19

"installing Zend Framework is so easy!!!!" yeah right...

“安装Zend框架太容易了!!!”

Ok I'm working with a beginner's book and the ONE thing that is not excessively detailed is the most important part: Installing the darn thing. After browsing the quickstart guide for hours, all it said was:

好吧,我正在写一本初学者的书,有一件事不太详细,那就是最重要的部分:安装该死的东西。在浏览了几个小时的quickstart指南后,上面写着:

"download Zend [...] add the include directory (bla bla) and YOU'RE DONE!"

“下载Zend[…添加include目录(bla),您就完成了!

right, i'm done using Zend.

我用Zend结束了。

Ok, not really, not yet anyway. I beg of you people, I wanna go to bed, please tell me how (in simple 6th grade detail) to install the framework. I've got the unzipped folder in my htdocs directory, and I placed zf.bat+zf.php in the htdocs root.

好吧,其实还没有。我请求你们大家,我想睡觉,请告诉我如何(在简单的六年级细节)安装框架。我在htdocs目录中有一个解压文件夹,我放置了zf.bat+zf。htdocs根中的php。

What's next?

接下来是什么?

thank you so much.

非常感谢。

8 个解决方案

#1


18  

It seems like you're having trouble with the PATH in the Windows command shell. This is independent of Zend Framework. Understanding the PATH concept in a shell environment is a hurdle many programmers have to overcome, but once you get it, you can use it to increase your productivity.

看起来您在Windows命令shell中遇到了路径问题。这与Zend框架无关。理解shell环境中的路径概念是许多程序员必须克服的一个障碍,但是一旦获得了它,就可以使用它来提高生产率。

You can always run a program from the command shell using that program's absolute path. For example:

您可以使用该程序的绝对路径从命令shell中运行程序。例如:

C:\> c:\wamp\bin\php\php.exe

You can also run a command using a relative path. That is, you enter the path from your current working directory to the location of the program you want to run.

您还可以使用相对路径运行命令。也就是说,您输入从当前工作目录到要运行的程序的位置的路径。

C:\> cd c:\wamp
C:\> bin\php\php.exe

But if you run a command in the command shell without naming the full path to the executable, the shell tries to find the program executable in one of the directories listed in your PATH environment variable. That is, the path is a string with directory names separated by semicolons. To run an executable, the shell tries each directory in that list, in order, as if you had

但是,如果您在命令shell中运行一个命令,而没有为可执行文件命名完整路径,那么shell将尝试在路径环境变量中列出的目录中查找程序可执行文件。也就是说,路径是一个用分号分隔的目录名的字符串。要运行可执行文件,shell将按顺序尝试列表中的每个目录,就像您曾经尝试过的那样

C:\> type %PATH%
C:\WINDOWS\;C:\WINDOWS\SYSTEM32
C:\> php.exe
...error that it cannot find php.exe...

Special case: running php.exe also works if your current working directory happens to be the location of that program executable. But that's just an example of using a relative path, using a path with zero directory levels.

特殊情况:运行php。如果您当前的工作目录恰好是程序可执行文件的位置,exe也可以工作。但这只是使用相对路径的一个例子,使用一个零目录级的路径。

Second problem is that you're running zf.bat which is a script that in turn invokes php.exe without specifying a path. It assumes you have added the location of php.exe to your PATH environment variable.

第二个问题是你在运行zf。bat是一个脚本,它反过来调用php。没有指定路径的exe。它假定您已经添加了php的位置。路径环境变量的exe。

C:\> SET PATH=%PATH%;C:\wamp\bin\php
C:\> php.exe -v
PHP 5.3.1 (cli) (built: Nov 29 2009 13:59:20) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

The zf.bat script itself also needs to be found. You can do this by adding the directory where it resides to your PATH. Assuming you installed Zend Framework under C:\zf, for example:

zf。bat脚本本身也需要找到。可以通过将目录所在的位置添加到路径中来实现这一点。假设您在C:\zf下安装了Zend框架,例如:

C:\> type %PATH%
C:\WINDOWS\;C:\WINDOWS\SYSTEM32;C:\wamp\bin\php
C:\> zf.bat
...error that it cannot find zf.bat...
C:\> SET PATH=%PATH%;C:\zf\bin
C:\> zf.bat show version
Zend Framework Version: 1.10.0dev

I would also recommend that you install Zend Framework outside your htdocs directory. There's only one PHP file you need under your htdocs: that is the single bootstrap file that Zend Framework uses to instantiate the Front Controller and dispatch the request.

我还建议您在htdocs目录之外安装Zend框架。htdocs下只有一个PHP文件需要:那就是Zend Framework用来实例化前端控制器并发送请求的单个引导文件。

When you use zf.bat to generate an skeleton application for you, it creates a directory public with a PHP script index.php inside that directory. This index.php file is the one you need to be in your htdocs directory. You also need assets like CSS, Javascript, and images to be under your htdocs. The rest of your application code, and the entire Zend Framework itself, should be outside your htdocs. Especially any config files where you store sensitive data such as your database password, etc.

当你利用zf。bat要为您生成一个框架应用程序,它使用PHP脚本索引创建一个目录公共。php内目录。这个指数。php文件是您需要放在htdocs目录中的文件。您还需要CSS、Javascript和图像等资产放在htdocs之下。应用程序代码的其余部分以及整个Zend框架本身应该位于htdocs之外。特别是任何存储敏感数据(如数据库密码等)的配置文件。

You can edit the index.php file. It may define a PHP constant APPLICATION_PATH, which is the location of the rest of your application code.

您可以编辑索引。php文件。它可以定义一个PHP常量APPLICATION_PATH,它是应用程序代码其余部分的位置。

<?php

defined("APPLICATION_PATH")
    || define("APPLICATION_PATH", realpath(dirname(__FILE__) . "/../application"
));

That default definition for APPLICATION_PATH assumes that your htdocs is a sister directory to the rest of your application code generated by the zf.bat tool. You can certainly put your app code anywhere else, but you have to change the above code so that the index.php script finds it.

APPLICATION_PATH的默认定义假定您的htdocs是zf生成的其余应用程序代码的姐妹目录。蝙蝠的工具。你当然可以把你的应用程序代码放在其他任何地方,但是你必须改变上面的代码,这样索引才行。php脚本找到它。

Also the index.php script may add the location of library code to PHP's INCLUDE_PATH. This is useful if you need to make the Zend Framework library findable, or if you use other third-party PHP code in your application. Assuming you installed Zend Framework under C:\zf, you should add its library subdirectory to your PHP INCLUDE_PATH.

也该指数。php脚本可以将库代码的位置添加到php的INCLUDE_PATH中。如果您需要查找Zend框架库,或者在应用程序中使用其他第三方PHP代码,这将非常有用。假设您在C:\zf下安装了Zend框架,您应该将它的库子目录添加到PHP INCLUDE_PATH中。

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    "C:/zf/library",
    realpath(APPLICATION_PATH . "/../library"),
    get_include_path()
)));

The code templates generated by the zf.bat script try to make sensible default guesses about where your code is located, but your environment is your own, and it's easy to edit these scripts to specify the true location where you installed your code and libraries.

zf生成的代码模板。bat脚本尝试对代码的位置进行合理的默认猜测,但是您的环境是您自己的,并且很容易编辑这些脚本,以指定您安装代码和库的真实位置。

#2


2  

The framework doesn't have to be in the htdocs folder, it can be anywhere. Once you decompressed it somewhere you're 50% done.

框架不必在htdocs文件夹中,它可以在任何地方。一旦在某个地方解压缩,就完成了50%。

Next step is to locate your php.ini file (for instance create a file <?php phpinfo();?> in your htdocs folder execute it and look for "Configuration (php.ini) filepath" (or similar) in the first block. In that file add the path to the ZendFramework to the include_dir directive. This has to include the library folder. Your setting might look like this:

下一步是定位php。ini文件(例如创建一个文件 执行它,并在第一个块中查找“配置(php.ini)文件路径”(或类似)。在该文件中,将ZendFramework的路径添加到include_dir指令。这必须包含库文件夹。您的设置可能是这样的:

include_dir = .;c:\php\ZendFramework\library

Often it also includes the path to PEAR.

通常它还包括到PEAR的路径。

Then restart your server.

然后重新启动服务器。

You are done.

你是做。

#3


2  

  1. Zend != Zend Framework
  2. Zend ! = Zend框架
  3. Zend Framework doesn't need to be installed. It is merely a library, it just needs to be placed somewhere.
  4. Zend框架不需要安装。它只是一个图书馆,只是需要放在某个地方。
  5. As johannes says you need to tell php where to look for the library so you add the folder where the Zend Framework library is located to your php include path.
  6. 正如johannes所说,您需要告诉php在哪里查找库,以便将Zend框架库所在的文件夹添加到php include路径中。

That's it, there is nothing more!

就这样,没有别的了!

Now it seems that your real problem has nothing to do with Zend Framework as such. You're trying to use Zend_Tool but the command line tool zf.bat is not on your system path so you are not able to use the command 'zf'. Zend Framework works fine without the tool, if you want to use it anyways, invoke the command, when you're in the folder where zf.bat resides or add the path to zf.bat to your system path.

现在看来,您真正的问题与Zend框架本身无关。您正在尝试使用Zend_Tool,但是命令行工具zf。bat不在系统路径上,因此不能使用“zf”命令。Zend Framework在没有工具的情况下运行良好,如果您想要使用它,请调用该命令,当您在zf的文件夹中。bat位于或添加路径到zf。切换到系统路径。

This means in a non-vague way:

这意味着以一种非模糊的方式:

if (path-to-zf.bat isOn SYSTEM_PATH)
{
    you can call 'zf' from anywhere;
}
else
{
    you must be in the folder where zf.bat also is, if you want to call 'zf';
}

#4


1  

Derived from http://normankosmal.com/wordpress/?p=47:

来自于http://normankosmal.com/wordpress/?p=47

****> ****Process  of install zend framework in window 
> 1) Download zend framework
> 2)After installing xampp extract the
> Zend Framework files into a folder of
> your choice. Next step is to edit the
> php.ini. Usually this file can be
> found in the php folder in your xampp
> installation. Find the line that says
> include_path and edit the line like
> this:
>     Windows: “\path1;\path2″
>     include_path = “.;D:\Informatik\SERVER\xampp\php\pear\;D:\Informatik\SERVER\xampp\php\ZendFramework\library”
>     3) 
>      did you add your php interpreter to %PATH%?
>     In which file i have to add the PHP interpreter?
>     You mean i need to edit zf.bat file
>     SET ZF_SCRIPT=%PHP_DIR%\zf.php
>     Here in place of %PHP_DIR% i need to add the path of my PHP directory?
>     Can you plzz help me out.
>     4) D:\Informatik\SERVER\xampp\htdocs>D:\Informatik\SERVER\xampp\php\ZendFramework\b
>     in\zf.bat create project testproject********

#5


0  

Gal - I had the same problem. We must be working on the same book this weekend.

我也有同样的问题。这个周末我们一定在写同一本书。

I solved the project-creation problem when I figured out that in the terminal window, you need to first navigate to the PHP home directory you created.

当我发现在终端窗口中,您需要首先导航到您创建的PHP主目录时,我解决了项目创建问题。

So in other words if you are in the PHP5 folder, type "zf create project c:/Apache/htdocs/projectname"

换句话说,如果你在PHP5文件夹中,输入"zf创建项目c:/Apache/htdocs/projectname"

I had the same issue re: missing php.exe file until I figured this out.

我遇到了同样的问题:缺少php。exe文件,直到我算出来。

--

- - -

That's the good news. The bad news is you're going to have similar problems when you try setting up Controllers and Actions, and my fix won't work for this. I still haven't figured this out, so I'll post again with more info and perhaps the others can help.

这是好消息。坏消息是,当你尝试设置控制器和操作时,你会遇到类似的问题,我的修复不能解决这个问题。我还没弄明白,所以我会再发一些信息,也许其他人也能帮上忙。

#6


0  

Easier to read if I type it here.

如果我在这里输入,会更容易阅读。

Here's a step-by-step:

这里有一个循序渐进的:

  • open terminal window
  • 打开终端窗口
  • type cd c:\
  • 输入cd c:\
  • type cd php
  • cd型php
  • type zf create project c:/APACHE/htdocs/PROJECTNAME
  • 类型zf创建项目c:/APACHE/htdocs/PROJECTNAME

Substitute your directory and project names where I used all caps.

将您的目录和项目名称替换为我使用的所有大写。

That should work. Notice that you had to navigate to the PHP home directory because this is where the php.exe file is, and this is where the zf.bat and zf.php files are. Apparently both are required when using Zend_Tool.

这应该工作。注意,您必须导航到PHP主目录,因为这是PHP所在的位置。exe文件是,这是zf。蝙蝠和zf。php文件。显然,在使用Zend_Tool时,两者都是必需的。

#7


0  

You don't say what web stack you're using, but the simplest way that I've found to work with Zend on Windows is to install Zend Core. This installs a complete stack pre-configured with the Zend Framework.

你没有说你使用的是什么web栈,但是我发现在Windows上使用Zend的最简单的方法是安装Zend Core。这将安装一个预先配置了Zend框架的完整堆栈。

#8


0  

Gal, I don't understand what do you want to do.

女孩,我不明白你想做什么。

There is no installation or configuration for the framework. You just have to

框架没有安装或配置。你只需要

  1. Unpack the framework anywhere
  2. 解压缩该框架在任何地方
  3. Create a project running zf create "myproject"
  4. 创建一个运行zf的项目,创建“myproject”
  5. Create a shourtcut/link in /library => root folder of the framework. You can also just unpack the whole framework in this folder (/library) but if you have many projects, you will end with many copies of the framework using diskspace.
  6. 在框架的/library =>根文件夹中创建shourtcut/link。您也可以在这个文件夹(/库)中解压整个框架,但是如果您有许多项目,那么您将使用diskspace得到该框架的多个副本。
  7. change you apache configuration for opening /myproject/public/index.php when redirecting the web browser to your site.
  8. 为打开/myproject/public/index更改apache配置。当将web浏览器重定向到您的站点时。

I mean, this have nothing to do with zf, if you create a site in your computer, you have to tell Apache where is it.

我的意思是,这和zf没有关系,如果你在你的电脑里创建一个网站,你必须告诉Apache它在哪里。

You always can run zf.bat writing the whole path. If zf.bat returns un error, then very probably you have problems with you php installation.

你总是可以运行zf。蝙蝠写下了整条路。如果zf。bat返回un错误,那么很可能在php安装中出现问题。

Just in case it's helpful, this is my apache configuration (httpd.conf) for a project named zf_cms

这是我的apache配置(httpd.conf),用于一个名为zf_cms的项目

<VirtualHost *:80>
ServerAdmin alex@conexion-seo.com.mx
DocumentRoot "C:\Users\alex\Documents\My Web Sites\zf_cms/public"
ServerName zf_cms.conexion

<Directory "C:\Users\alex\Documents\My Web Sites\zf_cms/public">
    #DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Then you have to add this line to %windir%\system32\drivers\etc\hosts

然后您必须将这一行添加到%windir%\system32\驱动器等等\主机上

127.0.0.1     zf_cms.conexion

#1


18  

It seems like you're having trouble with the PATH in the Windows command shell. This is independent of Zend Framework. Understanding the PATH concept in a shell environment is a hurdle many programmers have to overcome, but once you get it, you can use it to increase your productivity.

看起来您在Windows命令shell中遇到了路径问题。这与Zend框架无关。理解shell环境中的路径概念是许多程序员必须克服的一个障碍,但是一旦获得了它,就可以使用它来提高生产率。

You can always run a program from the command shell using that program's absolute path. For example:

您可以使用该程序的绝对路径从命令shell中运行程序。例如:

C:\> c:\wamp\bin\php\php.exe

You can also run a command using a relative path. That is, you enter the path from your current working directory to the location of the program you want to run.

您还可以使用相对路径运行命令。也就是说,您输入从当前工作目录到要运行的程序的位置的路径。

C:\> cd c:\wamp
C:\> bin\php\php.exe

But if you run a command in the command shell without naming the full path to the executable, the shell tries to find the program executable in one of the directories listed in your PATH environment variable. That is, the path is a string with directory names separated by semicolons. To run an executable, the shell tries each directory in that list, in order, as if you had

但是,如果您在命令shell中运行一个命令,而没有为可执行文件命名完整路径,那么shell将尝试在路径环境变量中列出的目录中查找程序可执行文件。也就是说,路径是一个用分号分隔的目录名的字符串。要运行可执行文件,shell将按顺序尝试列表中的每个目录,就像您曾经尝试过的那样

C:\> type %PATH%
C:\WINDOWS\;C:\WINDOWS\SYSTEM32
C:\> php.exe
...error that it cannot find php.exe...

Special case: running php.exe also works if your current working directory happens to be the location of that program executable. But that's just an example of using a relative path, using a path with zero directory levels.

特殊情况:运行php。如果您当前的工作目录恰好是程序可执行文件的位置,exe也可以工作。但这只是使用相对路径的一个例子,使用一个零目录级的路径。

Second problem is that you're running zf.bat which is a script that in turn invokes php.exe without specifying a path. It assumes you have added the location of php.exe to your PATH environment variable.

第二个问题是你在运行zf。bat是一个脚本,它反过来调用php。没有指定路径的exe。它假定您已经添加了php的位置。路径环境变量的exe。

C:\> SET PATH=%PATH%;C:\wamp\bin\php
C:\> php.exe -v
PHP 5.3.1 (cli) (built: Nov 29 2009 13:59:20) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

The zf.bat script itself also needs to be found. You can do this by adding the directory where it resides to your PATH. Assuming you installed Zend Framework under C:\zf, for example:

zf。bat脚本本身也需要找到。可以通过将目录所在的位置添加到路径中来实现这一点。假设您在C:\zf下安装了Zend框架,例如:

C:\> type %PATH%
C:\WINDOWS\;C:\WINDOWS\SYSTEM32;C:\wamp\bin\php
C:\> zf.bat
...error that it cannot find zf.bat...
C:\> SET PATH=%PATH%;C:\zf\bin
C:\> zf.bat show version
Zend Framework Version: 1.10.0dev

I would also recommend that you install Zend Framework outside your htdocs directory. There's only one PHP file you need under your htdocs: that is the single bootstrap file that Zend Framework uses to instantiate the Front Controller and dispatch the request.

我还建议您在htdocs目录之外安装Zend框架。htdocs下只有一个PHP文件需要:那就是Zend Framework用来实例化前端控制器并发送请求的单个引导文件。

When you use zf.bat to generate an skeleton application for you, it creates a directory public with a PHP script index.php inside that directory. This index.php file is the one you need to be in your htdocs directory. You also need assets like CSS, Javascript, and images to be under your htdocs. The rest of your application code, and the entire Zend Framework itself, should be outside your htdocs. Especially any config files where you store sensitive data such as your database password, etc.

当你利用zf。bat要为您生成一个框架应用程序,它使用PHP脚本索引创建一个目录公共。php内目录。这个指数。php文件是您需要放在htdocs目录中的文件。您还需要CSS、Javascript和图像等资产放在htdocs之下。应用程序代码的其余部分以及整个Zend框架本身应该位于htdocs之外。特别是任何存储敏感数据(如数据库密码等)的配置文件。

You can edit the index.php file. It may define a PHP constant APPLICATION_PATH, which is the location of the rest of your application code.

您可以编辑索引。php文件。它可以定义一个PHP常量APPLICATION_PATH,它是应用程序代码其余部分的位置。

<?php

defined("APPLICATION_PATH")
    || define("APPLICATION_PATH", realpath(dirname(__FILE__) . "/../application"
));

That default definition for APPLICATION_PATH assumes that your htdocs is a sister directory to the rest of your application code generated by the zf.bat tool. You can certainly put your app code anywhere else, but you have to change the above code so that the index.php script finds it.

APPLICATION_PATH的默认定义假定您的htdocs是zf生成的其余应用程序代码的姐妹目录。蝙蝠的工具。你当然可以把你的应用程序代码放在其他任何地方,但是你必须改变上面的代码,这样索引才行。php脚本找到它。

Also the index.php script may add the location of library code to PHP's INCLUDE_PATH. This is useful if you need to make the Zend Framework library findable, or if you use other third-party PHP code in your application. Assuming you installed Zend Framework under C:\zf, you should add its library subdirectory to your PHP INCLUDE_PATH.

也该指数。php脚本可以将库代码的位置添加到php的INCLUDE_PATH中。如果您需要查找Zend框架库,或者在应用程序中使用其他第三方PHP代码,这将非常有用。假设您在C:\zf下安装了Zend框架,您应该将它的库子目录添加到PHP INCLUDE_PATH中。

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    "C:/zf/library",
    realpath(APPLICATION_PATH . "/../library"),
    get_include_path()
)));

The code templates generated by the zf.bat script try to make sensible default guesses about where your code is located, but your environment is your own, and it's easy to edit these scripts to specify the true location where you installed your code and libraries.

zf生成的代码模板。bat脚本尝试对代码的位置进行合理的默认猜测,但是您的环境是您自己的,并且很容易编辑这些脚本,以指定您安装代码和库的真实位置。

#2


2  

The framework doesn't have to be in the htdocs folder, it can be anywhere. Once you decompressed it somewhere you're 50% done.

框架不必在htdocs文件夹中,它可以在任何地方。一旦在某个地方解压缩,就完成了50%。

Next step is to locate your php.ini file (for instance create a file <?php phpinfo();?> in your htdocs folder execute it and look for "Configuration (php.ini) filepath" (or similar) in the first block. In that file add the path to the ZendFramework to the include_dir directive. This has to include the library folder. Your setting might look like this:

下一步是定位php。ini文件(例如创建一个文件 执行它,并在第一个块中查找“配置(php.ini)文件路径”(或类似)。在该文件中,将ZendFramework的路径添加到include_dir指令。这必须包含库文件夹。您的设置可能是这样的:

include_dir = .;c:\php\ZendFramework\library

Often it also includes the path to PEAR.

通常它还包括到PEAR的路径。

Then restart your server.

然后重新启动服务器。

You are done.

你是做。

#3


2  

  1. Zend != Zend Framework
  2. Zend ! = Zend框架
  3. Zend Framework doesn't need to be installed. It is merely a library, it just needs to be placed somewhere.
  4. Zend框架不需要安装。它只是一个图书馆,只是需要放在某个地方。
  5. As johannes says you need to tell php where to look for the library so you add the folder where the Zend Framework library is located to your php include path.
  6. 正如johannes所说,您需要告诉php在哪里查找库,以便将Zend框架库所在的文件夹添加到php include路径中。

That's it, there is nothing more!

就这样,没有别的了!

Now it seems that your real problem has nothing to do with Zend Framework as such. You're trying to use Zend_Tool but the command line tool zf.bat is not on your system path so you are not able to use the command 'zf'. Zend Framework works fine without the tool, if you want to use it anyways, invoke the command, when you're in the folder where zf.bat resides or add the path to zf.bat to your system path.

现在看来,您真正的问题与Zend框架本身无关。您正在尝试使用Zend_Tool,但是命令行工具zf。bat不在系统路径上,因此不能使用“zf”命令。Zend Framework在没有工具的情况下运行良好,如果您想要使用它,请调用该命令,当您在zf的文件夹中。bat位于或添加路径到zf。切换到系统路径。

This means in a non-vague way:

这意味着以一种非模糊的方式:

if (path-to-zf.bat isOn SYSTEM_PATH)
{
    you can call 'zf' from anywhere;
}
else
{
    you must be in the folder where zf.bat also is, if you want to call 'zf';
}

#4


1  

Derived from http://normankosmal.com/wordpress/?p=47:

来自于http://normankosmal.com/wordpress/?p=47

****> ****Process  of install zend framework in window 
> 1) Download zend framework
> 2)After installing xampp extract the
> Zend Framework files into a folder of
> your choice. Next step is to edit the
> php.ini. Usually this file can be
> found in the php folder in your xampp
> installation. Find the line that says
> include_path and edit the line like
> this:
>     Windows: “\path1;\path2″
>     include_path = “.;D:\Informatik\SERVER\xampp\php\pear\;D:\Informatik\SERVER\xampp\php\ZendFramework\library”
>     3) 
>      did you add your php interpreter to %PATH%?
>     In which file i have to add the PHP interpreter?
>     You mean i need to edit zf.bat file
>     SET ZF_SCRIPT=%PHP_DIR%\zf.php
>     Here in place of %PHP_DIR% i need to add the path of my PHP directory?
>     Can you plzz help me out.
>     4) D:\Informatik\SERVER\xampp\htdocs>D:\Informatik\SERVER\xampp\php\ZendFramework\b
>     in\zf.bat create project testproject********

#5


0  

Gal - I had the same problem. We must be working on the same book this weekend.

我也有同样的问题。这个周末我们一定在写同一本书。

I solved the project-creation problem when I figured out that in the terminal window, you need to first navigate to the PHP home directory you created.

当我发现在终端窗口中,您需要首先导航到您创建的PHP主目录时,我解决了项目创建问题。

So in other words if you are in the PHP5 folder, type "zf create project c:/Apache/htdocs/projectname"

换句话说,如果你在PHP5文件夹中,输入"zf创建项目c:/Apache/htdocs/projectname"

I had the same issue re: missing php.exe file until I figured this out.

我遇到了同样的问题:缺少php。exe文件,直到我算出来。

--

- - -

That's the good news. The bad news is you're going to have similar problems when you try setting up Controllers and Actions, and my fix won't work for this. I still haven't figured this out, so I'll post again with more info and perhaps the others can help.

这是好消息。坏消息是,当你尝试设置控制器和操作时,你会遇到类似的问题,我的修复不能解决这个问题。我还没弄明白,所以我会再发一些信息,也许其他人也能帮上忙。

#6


0  

Easier to read if I type it here.

如果我在这里输入,会更容易阅读。

Here's a step-by-step:

这里有一个循序渐进的:

  • open terminal window
  • 打开终端窗口
  • type cd c:\
  • 输入cd c:\
  • type cd php
  • cd型php
  • type zf create project c:/APACHE/htdocs/PROJECTNAME
  • 类型zf创建项目c:/APACHE/htdocs/PROJECTNAME

Substitute your directory and project names where I used all caps.

将您的目录和项目名称替换为我使用的所有大写。

That should work. Notice that you had to navigate to the PHP home directory because this is where the php.exe file is, and this is where the zf.bat and zf.php files are. Apparently both are required when using Zend_Tool.

这应该工作。注意,您必须导航到PHP主目录,因为这是PHP所在的位置。exe文件是,这是zf。蝙蝠和zf。php文件。显然,在使用Zend_Tool时,两者都是必需的。

#7


0  

You don't say what web stack you're using, but the simplest way that I've found to work with Zend on Windows is to install Zend Core. This installs a complete stack pre-configured with the Zend Framework.

你没有说你使用的是什么web栈,但是我发现在Windows上使用Zend的最简单的方法是安装Zend Core。这将安装一个预先配置了Zend框架的完整堆栈。

#8


0  

Gal, I don't understand what do you want to do.

女孩,我不明白你想做什么。

There is no installation or configuration for the framework. You just have to

框架没有安装或配置。你只需要

  1. Unpack the framework anywhere
  2. 解压缩该框架在任何地方
  3. Create a project running zf create "myproject"
  4. 创建一个运行zf的项目,创建“myproject”
  5. Create a shourtcut/link in /library => root folder of the framework. You can also just unpack the whole framework in this folder (/library) but if you have many projects, you will end with many copies of the framework using diskspace.
  6. 在框架的/library =>根文件夹中创建shourtcut/link。您也可以在这个文件夹(/库)中解压整个框架,但是如果您有许多项目,那么您将使用diskspace得到该框架的多个副本。
  7. change you apache configuration for opening /myproject/public/index.php when redirecting the web browser to your site.
  8. 为打开/myproject/public/index更改apache配置。当将web浏览器重定向到您的站点时。

I mean, this have nothing to do with zf, if you create a site in your computer, you have to tell Apache where is it.

我的意思是,这和zf没有关系,如果你在你的电脑里创建一个网站,你必须告诉Apache它在哪里。

You always can run zf.bat writing the whole path. If zf.bat returns un error, then very probably you have problems with you php installation.

你总是可以运行zf。蝙蝠写下了整条路。如果zf。bat返回un错误,那么很可能在php安装中出现问题。

Just in case it's helpful, this is my apache configuration (httpd.conf) for a project named zf_cms

这是我的apache配置(httpd.conf),用于一个名为zf_cms的项目

<VirtualHost *:80>
ServerAdmin alex@conexion-seo.com.mx
DocumentRoot "C:\Users\alex\Documents\My Web Sites\zf_cms/public"
ServerName zf_cms.conexion

<Directory "C:\Users\alex\Documents\My Web Sites\zf_cms/public">
    #DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Then you have to add this line to %windir%\system32\drivers\etc\hosts

然后您必须将这一行添加到%windir%\system32\驱动器等等\主机上

127.0.0.1     zf_cms.conexion