Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Deploying Zend Frameork 2 “Hello World” Application [Ubuntu]

Let us learn to deploy Zend Skeleton Application provided by ZendFramework as our Hello World Application.

1.Clone Zend framework 2 Skeleton Application in the server root. Go to your server root and clone the skeleton application on github:
#git clone https://github.com/zendframework/ZendSkeletonApplication.git
You need to install before git to execute above command. If don’t have git installed then download the zip file from github. 2.Install Composer. It is a dependency manager for PHP.
#curl -sS https://getcomposer.org/installer | php
Update the Composer:
#php composer.phar self-update
3. Install all the dependencies for Zend Application using Composer. Go to the root of your Zend Application and execute following command:
#php composer.phar install
Above command will install all the dependencies defined in composer.json file. Zend framework 2 use Composer extensively to install the dependencies . All the dependencies r defined in composer.json files. 4. Set up the virtual host for your Zend Application. Open  /usr/local/zend/etc/sites.d/vhost_comm-app-80.conf file in any text editor, e.g vim:
# vim /usr/local/zend/etc/sites.d/vhost_comm-app-80.conf
vhost_comm-app-80.conf is the virtual host file in Zend Server. Add following codes in this file:
<VirtualHost *:80>
ServerName helloworld.local
DocumentRoot /var/www/helloworld/public
SetEnv APPLICATION_ENV “development”
<Directory /var/www/helloworld/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

 

Line# 2 : helloworld.local is the name of server.
Line#3  : /var/www/helloworld/public is the path to public folder of our hello world application.
Line#4  : We have set the Application environment of Zend to Development Mode.

5. Tell you system that helloworld.local points to the local host and not  remote host. Open /etc/hosts using any text editor and add helloworld.local to the list of host.
#vim /etc/hosts
Add following line to /etc/hosts files:
127.0.0.1       hellowolrd.local
 

6. All set! Now restart Zend Server, open browser ad navigate to helloworld.local , you will see default page of Zend skeleton application.
# service zend-server restart
 


This post first appeared on Technohunk.com| Daily Hacks In Plain English!, please read the originial post: here

Share the post

Deploying Zend Frameork 2 “Hello World” Application [Ubuntu]

×

Subscribe to Technohunk.com| Daily Hacks In Plain English!

Get updates delivered right to your inbox!

Thank you for your subscription

×