How to install Zftool (windows, linux)

Asked

Viewed 1,006 times

0

How to install zftool on windows and linux?

  • 1

    It is not a question. You should present the problem as question and answer. Write a question here and then add the answer below. You can add an answer to your question yourself.

  • personally I found it unnecessary but...

  • 1

    Are you in doubt in any part of the Zftool installation process or are you doing the process correctly and still going wrong? Because if you do not know anything about the subject the ideal is to look for a tutorial before

  • @Erloncharles see the issue of the question. He had trouble installing and wanted to share the solution, but had done as a forum post.

2 answers

2

Since the topic is about zend why not for Linux as well?

For Linux (versions based on Debian):

Launch the terminal and navigate to your server’s root directory (in my case /var/www):

$ cd /var/www

$ git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive nomedoseuprojeto

To install git in the terminal (Debian-based systems):

    $ sudo apt-get install git 
    //ou
    $ sudo aptitude install git

Access the Skeleton directory/folder that we clone with git

$ cd nomedoseuprojeto
$ php composer.phar self-update
$ php composer.phar install
$ php composer.phar require zendframework/zftool:dev-master

Inside the vendor/bin directory we have the file zf.php. It is zftool. To execute:

$ /var/www/nomedoseuprojeto/vendor/bin/zf.php version

You can create a symbolic link to facilitate

$ sudo ln -s /var/www/nomedoseuprojeto/vendor/bin/zf.php /bin/zf

And to run just be in the folder of some zend project. Following this post would be:

  $ cd /var/www/nomedoseuprojeto/ 
  $ zf version 

Something like:

Zftool - Zend Framework 2 command line Tool The application in this Folder is using Zend Framework 2.2.0dev

Type zf to list basic information.

1


My solution

  1. Create a folder where zftool will be in my case c:\server\zftool

  2. Download the zftool.phar in http://packages.zendframework.com/zftool.phar and put inside the folder above

  3. Still inside the folder, create a file called zf2.bat

    @echo off

    php C: server zftool zftool.phar %*

  4. Add folder path in windows path

    Start Menu > Computer > Right Button > Properties > Advanced System Settings > Advanced Tab> Environment variables

    In the Variable column look for 'Path' and click on edit and put at the end ;C:\server\zftool

    Obs*

    Should your php.exe is not in the path will not work. In my case php.exe is in C:\server\Zend\ZendServer\bin, just step 4 up would look like this

    ;C: server Zend Zendserver bin;C: server zftool

  5. Restart the computer.

  6. In the terminal type

    C:>zf2 --version

  7. The exit should be something like:

    Zftool - Zend Framework 2 command line Tool

    The application in this Folder is using Zend Framework 2.2.5

Browser other questions tagged

You are not signed in. Login or sign up in order to post.