Zend Framework 2 is an open source framework for developing web applications and services. It requires PHP >= 5.3. It uses 100% object-oriented code. This tutorial will help you to install Zend Framework 2 on your Ubuntu, Debian and LinuxMint systems.
1. Install Apache & PHP
First make sure that you have installed Apache2 and PHP5 on your system. If not have already installed use following command to install it.
$ sudo apt-get update $ sudo apt-get install apache2 php5 php5-cli
2. Install PHP Composer
After installing Apache2 and PHP5 on your system, you need to install PHP Composer on your system. Use the following set of commands to install it.
$ curl -sS https://getcomposer.org/installer | sudo php $ sudo mv composer.phar /usr/local/bin/composer $ sudo chmod +x /usr/local/bin/composer
3. Install Zend Framework 2
There are many ways available to install Zend Framework 2 on your system but I select following way. which looks easier to me.
$ cd /var/www $ sudo git clone git://github.com/zendframework/ZendSkeletonApplication.git $ sudo cd ZendSkeletonApplication $ sudo composer install
4. Start Web Server
Following command will start a PHP-CLI web server. This is useful for temporarily testing and helpful for development purpose.
$ php -S 0.0.0.0:8080 -t public/ public/index.php
Now access http://localhost:8080 in web browser.
5. Configure Apache Server
Let’s configure Zend Framework 2 as web application with Apache2. Create a configuration file in Apache server for Zend2 installation.
$ sudo vi /etc/apache2/sites-available/zend2.example.com.conf
and add the following content in file. Make the necessary changes as per your setup and Apache version.
<VirtualHost *:80> ServerName zend2.example.com DocumentRoot /var/www/ZendSkeletonApplication/public <Directory /var/www/ZendSkeletonApplication/public> AllowOverride All # Require all granted # For Apache version >=2.4 Order allow,deny # For Apache version < 2.4 Allow from all # For Apache version < 2.4 </Directory> </VirtualHost>
Now enable newly created site using following command.
$ sudo a2ensite zend2.example.com $ sudo service apache2 reload
All done! Enjoy developement with Zend Framework 2.
Hi ,
I am getting Internal Server Error error when run the site zend2.example.com