How to install zftool on windows and linux?
How to install zftool on windows and linux?
My solution
Create a folder where zftool will stay in my case I chose c:\server\zftool
Download zftool.phar
at link
and put it inside the above folder
Still inside the folder, create a file named zf2.bat
@echo off
php C: \ server \ zftool \ zftool.phar% *
Add folder path in windows path
Start Menu > Computer > Right Button > Properties > Advanced System Settings > 'Advanced' tab > Environment Variables
In the Variable column, search for 'Path' and click edit and place at the end
;C:\server\zftool
If your php.exe
is not in path
it will not work. In my case php.exe
is in
C:\server\Zend\ZendServer\bin
, so step 4 above would look like this
C: \ server \ ZendServer \ bin; C: \ server \ zftool
Restart your computer.
In the terminal type
C: > zf2 --version
The output should be something like:
ZFTool - Zend Framework 2 command line Tool
The application in this folder is using Zend Framework 2.2.5
Since the topic is about zend why not for Linux too?
For Linux (Debian-based versions):
Start the terminal and navigate to the root directory of your server (in my case / var / www):
$ cd /var/www
$ git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive nomedoseuprojeto
To install git on the terminal (Debian-based Systems):
$ sudo apt-get install git
//ou
$ sudo aptitude install git
Access the skeleton directory / folder that we cloned with git
$ cd nomedoseuprojeto
$ php composer.phar self-update
$ php composer.phar install
$ php composer.phar require zendframework/zftool:dev-master
Within the vendor / bin directory we have the file zf.php. He's zftool. To run:
$ /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 execute just be in the folder of some zend project. Following this post would be:
$ cd /var/www/nomedoseuprojeto/
$ zf version
You'll see 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 the basic information.