校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > Ubuntu10.10 Zend FrameWork配置方法及helloworld顯示

Ubuntu10.10 Zend FrameWork配置方法及helloworld顯示

熱門標簽:企業電話機器人靠譜嗎 河北點撥外呼系統哪家公司做的好 各種地圖標注 福州營銷電銷機器人招商 地圖標注不在現場怎么上傳門頭標 400電話申請商客通 地圖標注員騙局 文德數慧科技有限公司 智能外呼系統的選購

、大概思路

1.1

(備注:安裝Zend Framework,其附帶apache2php5)

1.2、

 

Zend Framework配置

2.1、安裝Zend Framework

ubuntu10.10的軟件中心安裝zf.

2.2、激活apacherewrite模塊

命令行輸入:sudo a2enmod rewrite

 

2.3、配置PHP5路徑

配置include_path路徑信息,修改/etc/php5/con.d目錄下的zend-framework.ini

終端輸入:sudo gedit /etc/php5/conf.d/zend-framework.ini

2.4、創建firstProject項目

終端輸入:zf create project firstProject

(其路徑默認為 Ubuntu主文件目錄下)

 

2.5、在Apache2建立firstProject項目配置文件

因為apache默認的web目錄是在/var/www下,為了能夠讓 apache自動定位到指定目錄下的web應用,這里我們在/etc/apache2/conf.d中創建一個關于firstProject的配置文件,稱為 firstProject.conf

終端輸入:sudo gedit /etc/apache2/conf.d/firstProject.conf

文件的內容是:

復制代碼
代碼如下:

IfModule alias_module>
Alias /firstProject "/home/administrator/firstProject/public/"
Directory "/home/administrator/firstProject/public/">
Allow from all
RewriteEngine on
RewriteBase /firstProject
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !\.(css|js|jpg|gif|png|swf|flv)$ index.php
Options FollowSymlinks MultiViews
AllowOverride All
/Directory>
/IfModule>

2.6、修改項目firstProjectpublic文件下的.htaccess

增加一行RewriteBase /firstProject

.htaccess默認是隱藏的,可按快捷鍵Ctrl+H顯示出來)

RewriteEngine On

RewriteBase /firstProject

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

RewriteRule ^.*$ index.php [NC,L]

 

2.7、啟動運行http://localhost/firstProject

 

Zend Framework顯示hello 

3.1、從終端進入firstProject文件夾內,運行zf create Controller showhello 
3.2、編寫application/controllers/ShowhelloController.php

復制代碼
代碼如下:

?php
class ShowhelloController extends Zend_Controller_Action {
public function init() {
/* Initialize action controller here */
}
public function indexAction() {
// action body
$this->view->content = "Hello World";
$this->render ();
}
}

3.3、編寫application/views/scripts/showhello/index.phtml

復制代碼
代碼如下:



center>View script for controller b>Showhello /b> and script/action
name b>index/b>
p>font color="#FF0000">
?=$this->content;?>
/font>/p>
/center>

3.4、運行http://localhost/firstProject/showhello

四、總結

配置環境雖然是件很麻煩的事,但是只要花一些時間,總可以找到相應的解決方法。

標簽:潛江 鎮江 新余 鎮江 南陽 長沙 曲靖 雞西

巨人網絡通訊聲明:本文標題《Ubuntu10.10 Zend FrameWork配置方法及helloworld顯示》,本文關鍵詞  Ubuntu10.10,Zend,FrameWork,配置,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Ubuntu10.10 Zend FrameWork配置方法及helloworld顯示》相關的同類信息!
  • 本頁收集關于Ubuntu10.10 Zend FrameWork配置方法及helloworld顯示的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 大厂| 五家渠市| 玛曲县| 邳州市| 旬阳县| 田林县| 湘西| 扬中市| 龙江县| 奇台县| 休宁县| 凤阳县| 桦川县| 彰化县| 庄河市| 鹤峰县| 项城市| 平谷区| 盐山县| 天祝| 邹城市| 泾源县| 鄱阳县| 丰顺县| 库伦旗| 丽水市| 新安县| 博白县| 景宁| 泸定县| 华安县| 东港市| 监利县| 宝应县| 合川市| 苏尼特左旗| 盘锦市| 桦南县| 洪泽县| 寻乌县| 嘉禾县|