Zend_Tool问题

时间:2011-06-28 14:11:49

标签: zend-studio zend-server zend-tool

这是我第三次安装zend studio和zend服务器,现在这两个成功安装(半天后)。但是当我试图创建一个新项目时,我总是得到这个zf错误......

`     的 * ** * ** * ** * ** * ** ZF错误 * ** * ** * ** * ** * ** *     为了运行zf命令,您需要确保Zend Framework     在你的include_path里面。您可以通过多种方式进行操作     确保此zf命令行工具知道Zend Framework的位置     库在您的系统上,但并非所有这些都可以在这里描述。

The easiest way to get the zf command running is to give it the include 
path via an environment variable ZEND_TOOL_INCLUDE_PATH or 
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use,
then run the command "zf --setup".  This command is designed to create
a storage location for your user, as well as create the zf.ini file
that the zf command will consult in order to run properly on your
system.  

Example you would run:

$ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup

Your are encourged to read more in the link that follows.
Zend_Tool & CLI Setup Information
(available via the command line "zf --info")
   * Home directory found in environment variable HOMEPATH with value \Users\admin
   * Storage directory assumed in home directory at location \Users\admin/.zf/
   * Storage directory does not exist at \Users\admin/.zf/
   * Config file assumed in home directory at location \Users\admin/.zf.ini
   * Config file does not exist at \Users\admin/.zf.ini

To change the setup of this tool, run: "zf --setup"

ok(0:04.038) `

我已经通过命令行使用新的zend-framework库设置了ZF_INCLUDE_PATH。

我从来没有使用与zend相关的任何东西进行干净安装。

有人可以帮我这个吗?

由于

2 个答案:

答案 0 :(得分:0)

我假设您正在使用Windows机器的路径。 Zend Studio使用zend工具(windows中的zf.bat)来创建项目。要使其工作,您必须正确安装zend工具,即您必须能够打开控制台(WINDOWS + R,键入cmd,键入enter)并成功运行zf命令。

在您的情况下,可能是路径问题,您可以按照此处的说明进行解决:http://framework.zend.com/manual/en/zend.tool.framework.clitool.html#zend.tool.framework.clitool.setup-windows

特别是:

  

Windows Win32环境中最常见的设置是将zf.bat和zf.php复制到与PHP二进制文件相同的目录中。这通常可以在以下某个地方找到:

C:\PHP
C:\Program Files\ZendServer\bin\
C:\WAMP\PHP\bin
  

您应该能够在命令行上运行php.exe。如果您无法,请首先查看PHP发行版附带的文档,或确保php.exe的路径位于Windows PATH环境变量中。

     

下一步的业务是确保在系统PHP include_path中正确设置Zend Framework库。要找出include_path的位置,可以输入php -i并查找include_path变量,或者更简洁地执行php -i | grep include_path如果你有greg可用的Cygwin设置。一旦找到了include_path所在的位置(这通常类似于C:\ PHP \ pear,C:\ PHP \ share,C:\ Program%20Files \ ZendServer \ share或类似),请确保其内容library /目录放在include_path指定目录中。

答案 1 :(得分:0)

如果您在Ubuntu或Debian上运行 - 或者通常在Linux上运行 - 现在看来您必须创建环境变量 ZEND_TOOL_INCLUDE_PATH 。在 include_path 中使用zend框架(或将zend框架复制到现有的 include_path )似乎不再起作用。

要在Ubuntu / Debian上手动安装最新版本的zend框架,这是我在下载ZF并将其解压缩到〜/ temp

之后所做的
sudo cp -R ~/temp/ZendFramework-1.11.11/library/Zend /usr/share/php
sudo cp -R ~/temp/ZendFramework-1.11.11/extras/library/ZendX /usr/share/php
sudo cp ~/temp/ZendFramework-1.11.11/bin/zf.sh /usr/bin
sudo cp ~/temp/ZendFramework-1.11.11/bin/zf.php /usr/bin

接下来编辑/ etc / environment,如果你想让Netbeans等其他程序能够调用zf.sh.编辑〜/ .pam_environment,如果只希望当前用户执行zf.sh.添加以下行:

ZEND_TOOL_INCLUDE_PATH=/usr/share/php

您可能需要注销并在执行此操作后重新登录。

相关问题