ServerZoo虛擬主機使用教學文件區 Home      會員列表      Register Now!
舊 2013-11-12, 11:27 PM   #1
Tech-SZ 的頭像

預設 網站空間上使用支援Zend Framework

如果您於ServerZoo 虛擬主機網站空間上要使用自己的Zend framework 您可以到 下載後,並上傳到您網站上使用即可 ,完整教學如下範例

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

# 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 Community Downloads - 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
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 :

Set aliase for Zend/bin/ binary with following command :

$ alias zf='/home/cpusername/public_html/Zend/bin/'

$ chmod 755 /home/cpusername/public_html/Zend/bin/

$ 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
Done !

Access :

# 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.

此篇文章於 2014-03-11 10:46 PM 被 Tech-SZ 編輯。.
Show SignatureDisplay Signature 回覆時引用此篇文章




啟用 BB 代碼
論壇啟用 表情符號
論壇啟用 [IMG] 代碼
論壇禁用 HTML 代碼


所有時間均為台北時間。現在的時間是 10:10 PM

Powered by vBulletin® 版本 3.8.0
版權所有 ©2000 - 2018,Jelsoft Enterprises Ltd.