婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 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顯示的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 翼城县| 文成县| 东源县| 瑞金市| 韩城市| 清河县| 永年县| 永德县| 县级市| 德安县| 吴旗县| 综艺| 崇义县| 上犹县| 昭平县| 七台河市| 吉隆县| 客服| 台中县| 太原市| 阿鲁科尔沁旗| 阿合奇县| 肇源县| 商都县| 邵阳市| 巨野县| 辰溪县| 濉溪县| 读书| 财经| 兰西县| 信宜市| 长泰县| 金山区| 荣成市| 定日县| 晋宁县| 广宁县| 峡江县| 科技| 桓仁|