PHP frameworks have multiple benefits in web development as rapidly web application development,
user-friendly URL namespaces, classes and methods.
Based on Model-View-Controller (MVC) paradigm and supplied with a new command line tool,
Zend Framework is gaining popularity in PHP object-oriented web applications development.
Here is simple tutorial to install and configure the Zend framework under Linux Cpanel shared account.
system requirement
Configuration# PHP 5.2.4 or later version and apache mod_rewrite module.
# SUEXEC enabled server ( To affect account level PHP enviournment in php.ini file )
# Jailshell access.
# Get Zend Framework from zend.com/community/downloads Zend Community Downloads - Zend.com and extract the contents to your local disk.
# Extract ZendFramework-XX.tar.gz and rename 'ZendFramework-x.x.x' folder to Zend
# Upload 'Zend' folder under Document root : Eg. /home/cpusername/public_html/
Please make sure FTP transfers the files in binary mode (BIN).
# Display the PHP information. Create a file 'info.php' with the following line in it:
<?php phpinfo(); ?>
# Visit your site or preview site and open info.php - make a note of the "DOCUMENT_ROOT" value, and the "include_path" value.
# create php.ini file under same folder and add your zend library path in include path , enable allow_url_fopen and allow_url_include functions:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/cpusername/public_html/Zend/library"
allow_url_fopen = On
allow_url_include = On
# open .htaccess file and put following line :
SetEnv PHPRC /home/cpusername/public_html/php.ini
# create zend-test.php file and put following code :
<?
require_once 'Zend/Mail.php';
$mail=new Zend_Mail();
echo 'it is working';
?>
# Access domain.com/zend-test.php
It will show "it is working" message if everything goes fine
Now let's create one test application using ZF Command Line tool (CLI) which is supplied with Zend Framework
You can get detail ZF CLI usage information here : framework.zend.com/manual/en/zend.tool.usage.cli.html
Done !Set aliase for Zend/bin/zf.sh binary with following command :
$ alias zf='/home/cpusername/public_html/Zend/bin/zf.sh'
$ chmod 755 /home/cpusername/public_html/Zend/bin/zf.shzf.sh
$ zf show version
$ zf --help
cd /home/cpusername/public_html/
$ zf create project my-zf-test
It will say : Creating project at /home/cpusername/public_html/Zend/my-zf-test
Note: This command created a web project, for more information setting up your VHOST, please see docs/README
Access : domain.com/my-zf-test/public/
# Contact to support to update the domain document root directly to the public directory where your ZF application resides :
Eg. /home/cpusername/public_html/my-zf-test/public
Now just set appropriate redirect rules under .htaccess file.
For more information please refer ZF manual here : framework.zend.com/manual


Reply With Quote


