zend framework zf command not working

心不动则不痛 提交于 2019-12-25 08:24:11

问题


m using wamp and zend framework. firstly i had installed wamp localhost working fine then. downloaded Zend framework. added php path, zend library path in environment variable of windows. enabled rewrite module and set include path in php.ini which i get correct in phpinfo file. after this m trying to execute

zf create project FirstProject

after this command on console i get an error

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"

thanks for ur help in advance.


回答1:


I know you said you've added the php and library path but if you could make sure again that the your environment variables are definitley set correctly that would be great.

NOTE: it's the bin directory that is needed for zend tool to work correctly.

If still not working after this let me know and we can go from there.

Variable name: should be set to

Path

And the Variable value: should contain a link like

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

Your link is likely to be different as I installed Zend Server in a different location from default and the framework is available through the 'share' directory.

Make sure the link you put in there points to the directory that the zf.bat (on a Windows system - I believe you're using WAMP) lives in and you should be able to test it's working from a command prompt using just the zf command.

To get to the GUI where you can update the environment variables:

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

Hope this helps,

Dave




回答2:


The fact that your getting this message means its finding the zf tool in bin just fine. Its the location of your zend library files its not finding. You must copy just the /Zend folder from the /library/Zend in the unzipped dir into some location. The preferred way is to copy the /Zend folder right into your php/includes folder and that way don't even have to add anything to your php.ini include_path parameter or you must at least un-comment it. So after you move the dir will look like /php/includes/Zend and the include_path will be 'c:\php\includes'




回答3:


"So after you move the dir will look like /php/includes/Zend and the include_path will be 'c:\php\includes'"

Im not a PHP pro developer, but I'd remark in the above good explanation that Andy gave, that you should be careful to set the include_path only with 'c:\php\includes' and not with 'c:\php\includes\Zend' as I supposed, and didn't work till I tested taking out the 'Zend' from the path ... hope this is useful. Cheers.




回答4:


Try this simple technique:

STEP 1 : create a folder in your Program Files directory and name it ZendFrameworkCli.

C:\Program Files\ZendFrameworkCli

STEP 2 : copy bin and library from your Zend Framework files and paste into above mentioned directory.

SEPT 3 : set paths going into system settings environment variables. For PHP it will be C:\wamp\bin\php\php5.3.5; and to use Zend from client C:\Program Files\ZendFrameworkCli\bin;



来源:https://stackoverflow.com/questions/9045270/zend-framework-zf-command-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!