1)在index.php文件修改:
2)params.php里按需更改dbtype
3)创建一个 .htaccess文件放在web目录下,就是index.php同目录下
Options +FollowSymLinks
IndexIgnore /
RewriteEngine on
# 如果文件存在,就直接访问文件,不进行下面的RewriteRule
RewriteCond %{REQUEST_FILENAME} !-f
# 如果是一个目录或者文件,就访问目录或文件
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
4)在 apache 的 httpd.conf 文件中,DocumentRoot 为你项目所在的目录,如果不是请修改。
把下面这句的注释去掉。
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
5)在 apache 的 httpd-vhosts.conf 文件中,添加以下内容,XXX为你项目名,或者你项目路径
<VirtualHost *:80>
DocumentRoot "E:\XXX\web"
ServerName frontend.com
ServerAlias
<Directory "E:\XXX\web">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
# 开启 mod_rewrite 用于美化 URL 功能的支持(译注:对应 pretty URL 选项)
RewriteEngine on
# 如果请求的是真实存在的文件或目录,直接访问
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 如果请求的不是真实文件或目录,分发请求至 index.php
RewriteRule . index.php
</Directory>
</VirtualHost>
6)重启 apache , 此时应该已经可以访问了,但数据库还没连上
7)根据数据库配置信息连接数据库