2012-01-28 46 views
0

m使用wamp和zend框架。首先我安装了wamp localhost,然后运行正常。 已下载Zend框架。 在windows的环境变量中增加了php路径,zend库路径。 启用重写模块,并在php.ini中设置包含路径 ,我在phpinfo文件中得到正确。 在此之后米试图在控制台上此命令后,执行zend framework zf命令不起作用

zf create project FirstProject 

我得到一个错误

In order to run the zf command, you need to ensure that Zend Framework 
is inside your include_path. There are a variety of ways that you can 
ensure that this zf command line tool knows where the Zend Framework 
library is on your system, but not all of them can be described here. 

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. 

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

感谢UR提前帮助。

回答

2

我知道你说过你已经添加了php和库路径,但是如果你可以再次确定你的环境变量是正确设置的,那将是很棒的。

注意:这是zend工具正常工作所需的bin目录。

如果在此之后仍然不工作,请让我知道,我们可以从那里开始。

变量名称:应设置为

Path 

和变量值:中应包含

C:\Zend\ZendServer\share\ZendFramework\bin; 

您的链接的链接可能是不同的,因为我安装了Zend服务器在不同的默认的位置,框架可通过'share'目录获得。

确保您放入的链接指向zf.bat(在Windows系统上 - 我相信您使用WAMP)的目录,您应该能够从命令提示符下测试它的工作情况只使用zf命令。

要进入GUI,你可以更新环境变量:

1) Right click on the Computer icon on your Desktop and choose Properties option. 
2) In the System window click on Advanced system settings in the left pane 
3) In the System Properties window select Advanced tab and click on Environment Variables 
4) In the Environment Variables window you will notice two columns - User variables for a username and System variables 
5) In the System variables section scroll down to 'Path' and then highlight it and click 'Edit' 
6) At the end of the last entry place a ; character and then paste the path to the ZendFramework\bin on your system like above 

希望这有助于

戴夫

+0

thnks for your help。 – 2012-01-28 13:21:36

+0

不用担心; --D,它工作吗? – dkcwd 2012-01-28 13:24:23

+0

只是一个问题,我没有Zend服务器。我只有Zend Framework和zf.bat文件路径被添加到环境变量中,但它仍然会给出错误。我早些时候安装了Zend Server,但删除了之后是否需要安装Zend Server? coz m遵循Zend Framework初学者指南中的说明n他们已经在命令行中请求zend框架 – 2012-01-28 13:27:44

1

您收到此消息意味着其找到ZF工具的事实在垃圾桶里就好了。它的zend库文件的位置没有找到。您必须将解压目录中的/ library/Zend中的/ Zend文件夹复制到某个位置。首选的方法是将/ Zend文件夹直接复制到你的php/includes文件夹中,并且这种方式甚至不需要向你的php.ini include_path参数添加任何东西,或者你至少必须取消它的评论。所以在你移动目录之后,你会看到/ php/includes/Zend和include_path将会是'c:\ php \ includes'

1

“所以在你移动目录后,你会看到/ php/includes/Zend和include_path将是'c:\ php \ includes'“

我不是一个PHP专业开发人员,但我会在上面给出的Andy解释的好解释中说过,你应该小心地将include_path设置为'c :\ php \ includes',而不是'c:\ php \ includes \ Zend',因为我认为,直到我测试出从路径中取出'Zend'时才工作......希望这是有用的。干杯。

0

试试这个简单的方法:

第1步:在Program Files目录下,并将其命名ZendFrameworkCli创建一个文件夹。

C:\Program Files\ZendFrameworkCli 

第2步:副本binlibrary从Zend框架文件,并贴到上面提到的目录中。

SEPT 3:设置进入系统设置环境变量的路径。 对于PHP,它将是C:\wamp\bin\php\php5.3.5; 并使用来自客户端的Zend C:\Program Files\ZendFrameworkCli\bin;