Ubuntu10.10 Zend FrameWork配置及helloworld显示

、大概思路

1.1

( 备注:安装 Zend Framework ,其附带 apache2 php5)

1.2、

 

Zend Framework 配置

2. 1 、安装 Zend Framework

ubuntu10.10 的软件中心安装 zf.

 2. 2 、激活 apache rewrite 模块

命令行输入 :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

文件的内容是:


2.6 、修改项目 firstProject public 文件下的 .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 、启动运行 (要重启服务器 sudo /etc/init.d/apache2 restart http://localhost/firstProject

 

Zend Framework 显示 hello

 

3.1 、从终端进入 firstProject 文件夹内,运行 zf create Controller showhello

 

3.2 、编写 application/controllers/ShowhelloController.php

   
   









3.3 、编写 application/views/scripts/showhello/index.phtm

3. 4、运行 http://localhost/firstProject/showhello

四、总结

配置环境虽然是件很麻烦的事,但是只要花一些时间,总可以找到相应的解决方法。

参考网址: http://www.linguofeng.com/2010/10/ubuntu-10-10-configuration-zend-framework.html


知识共享许可协议

本作品 采用知识共享署名-非商业性使用 2.5 中国大陆许可协议 进行许可。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值