PHP: How to Install Zend Framework v1 (zf1)

Submitted by admin on Tue, 02/20/2018 - 22:31

You can install Zend Framework v2 as follows:
composer require zendframework/zendframework

However Zend Framework v1 has already been obsolete, therefore when you want to install it manually, you need to download the library from GitHub, and copy (move) to your application directory.

Download Zend Framework v1 library from GitHub (Note that the following example is aimed for minimal package. If you want to install the full package, delete a -minimal portion. Also note that the following command line is just one line, even though it has new lines.)

curl -LO https://github.com/zendframework/zf1/releases/download/$(curl -s https://api.github.com/repos/zendframework
/zf1/releases/latest | grep tag_name | cut -d '"' -f 4)/ZendFramework-$(curl -s https://api.github.com/repos/zendframewo
rk/zf1/releases/latest | grep tag_name | cut -d '"' -f 4 | sed s/release-//g)-minimal.tar.gz

Extract the library

tar xfz ZendFramework-$(curl -s https://api.github.com/repos/zendframework/zf1/releases/latest | grep tag_name | cut
-d '"' -f 4 | sed s/release-//g)-minimal.tar.gz ZendFramework-$(curl -s https://api.github.com/repos/zendframework/zf1/
releases/latest | grep tag_name | cut -d '"' -f 4 | sed s/release-//g)-minimal/library

Copy (mv) the library to your application directory. (Change the <YOUR_APPLICATION_DIR_NAME_HERE> portion to a directory name that your application is located.)

export INSTALL_DIR='<YOUR_APPLICATION_DIR_NAME_HERE>'
mv ZendFramework-$(curl -s https://api.github.com/repos/zendframework/zf1/releases/latest | grep tag_name | cut -d '
"' -f 4 | sed s/release-//g)-minimal/library ${INSTALL_DIR}

Add a path ./library to /etc/php7/php.ini.

sed -i s'|;include_path = "\.:/php/includes"|include_path = ".:./library"|'g /etc/php7/php.ini

Tags