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
ConfigurationCode:# 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.
Code:# 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 !Code: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
Hi,
I have followed your instructions and I am encountering problem when I do ZF show version.
Please see the below.
<br />
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/home/sites/sochkur.com/public_html/Zend/bin/zf.php</b> on line <b>38</b><br />
Please click the below link, if you want to see the screenshot of the steps I followed.
http://img703.imageshack.us/f/28876505.jpg/
Regards
Rob
Please confirm if you're satisfying the requirements...
# 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 )
Thanks
Awsome work. I will try it now
Awsome work. I will try it now
gr8 thanks
Bookmarks