Zend Framework的设置(apache)
- 编辑C:WINDOWSSystem32driversetchosts文件,增加一个域,如127.0.0.1 audit.local
- 修改apache的configure文件,在xampp环境下就是在d:/xampp/apache/conf目录下,首先编辑httpd.conf,开启rewrite模块:将这行的注释去掉:LoadModule rewrite_module modules/mod_rewrite.so然后编辑extra/http-vhosts.conf文件,增加如下行:
<VirtualHost *:80>然后去掉NameVirtualHost这行的注释,重新启动apache,就可以开始使用了更多关于apache rewrite rule的写法和说明。
DocumentRoot "D:/xampp/htdocs/"
ServerName localhost
ErrorLog logs/localhost.error_log
CustomLog logs/localhost.access_log common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/audit/public/"
ServerName audit.local
ErrorLog logs/audit.error_log
CustomLog logs/audit.access_log common
RewriteEngine off
<Location />
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !.(js|ico|gif|jpg|jpeg|pdf|png|css)$ /index.php
</Location>
<directory "D:/xampp/audit/public">
#Allow server side include,cgi, disable directory index
Options FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</directory>
</VirtualHost>
如果在nginx服务器上,参考nginx下的zend framework的设置 - 下载zend framework并安装到php/lib目录下
- 建立项目的文件目录,你可以用最基本的zend framework quick start中推荐的结构,也可以直接使用我们项目使用的ZF1.6标准目录结构。
此文发布时ZF的版本为1.6.1
相关文章: