喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

上一主题 下一主题
     
标题: Zend Framework配置  
 
xgwork
乞丐




UID 71637
精华 0
积分 -1
帖子 43
金钱 -1 喜悦币
威望 0
人脉 0
阅读权限 1
注册 2006-4-14
状态 离线
Zend Framework配置

这几天有些人一直问我如何配置Zend Framework,应大家的要求,我写了这个.由于自身水平有限,写得不好,还请大家凑合着吧!

1.启用Apache的mod_rewrite模块.

2.让.htaccess生效.(这点很多人没注意)

指令的生效
.htaccess文件中的配置指令作用于.htaccess文件所在的目录及其所有子目录, 但是,很重要需要记住的是,其更高级的目录也可能会有.htaccess文件, 而指令是按查找顺序依次生效,所以, 一个特定目录下的.htaccess文件中的指令可能会覆盖其更高级目录中的 .htaccess文件的指令,即, 子目录中的指令会覆盖更高级目录或者主服务器配置文件中的指令。

例如:

目录/www/htdocs/example1中的.htaccess文件有如下内容:

Options +ExecCGI

(注意: 必须设置"AllowOverride Options"以允许在.htaccess文件中使用 "Options"指令。)

在目录/www/htdocs/example1/example2中的.htaccess文件有如下内容:

Options Includes

由于第二个.htaccess文件的存在,/www/htdocs/example1/example2中 的CGI执行是不允许的,而只允许Options Includes,它完全覆盖了之前的设置。
我的做法把httpd.conf里面的"Options"指令

<Directory "D:/apche/Apache2/htdocs">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options FollowSymLinks
    AllowOverride All

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from All

</Directory>
看.htaccess是否可以用

.htaccess内容

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|swf)$ index.php
php_value include_path "./library"
注意: 这里的.htaccess在windows无法直接建立.我个人是先建立33.htaccess然后把leaftp打开.找到本地的33.htaccess,重命名位.htaccess就可以了。哈。.

5.测试下.htaccess是否可以用 打开本地的http://localhost/  随便打入http://localhost/33  看会不会转到http://localhost/ 如果不会说明你的.htaccess没有生效.

4.下载Zend Framework   http://framework.zend.com/download

(解压后把library文件夹放在网站的根目录下)


注意问题:.htaccess一定要让它生效...

补充问题:  .htaccess里面的php_value include_path 在linux下有的无法使用的。可以通过set_include_path()函数来设置(放在require_once()之前)。
如:index.php里面要这样:
set_include_path('./library');
include 'Zend';
或者你也可以直接在php.ini里面设置.

本文为作者原创http://www.phpwb.com/bbs/thread-35-1-1.html




www.176k.cn
www.176k.cn人人都是站长,人人都赢利
2006-7-11 10:51 AM#1
查看资料  发短消息  顶部
 
MORR
注册会员
Rank: 2



UID 72404
精华 0
积分 66
帖子 48
金钱 66 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-4-26
状态 离线
[推荐阅读] LINUX+PHP +MYSQL 工作两年,要6000可以吗?
非常好啊
2006-7-21 04:20 AM#2
查看资料  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 


Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.029201 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP