百秀项目的过程记录

1. 选用技术:后台:apache+ph 数据库:mysql 前台:html+css+bootstrap
2. 网站目录设置

baixiu:.
│  index.php
│
├─admin
│      index.php
│
└─static
    ├─assets
    └─uploads
注释:做法在cmd中执行D:\www\baixiu>tree /f得到

3. 配置虚拟主机,小的注意点: #Options Indexes FollowSymLinks中的indexs删除后,页面中不会显示文件目录
文件目录:apache/cofig/extra/vhost
在host文件下添加域名


    #网站根目录
    DocumentRoot "D:/www/baixiu"
    
    #Options Indexes FollowSymLinks中的indexs删除后,页面中不会显示文件目录
    Options FollowSymLinks
    AllowOverride None
    Require all granted
    
    #域名
    ServerName baixiu.io
   ErrorLog "logs/baixiu.io-error.log"    
   CustomLog "logs/baixiu.io-access.log" common

4. 创建配置文件cofig.php,添加基本信息

/**
 * 数据库主机
 */
define('DB_HOST','localhost');
/**
 * 数据库用户名
 */
define('DB_USER','root');
/**
 * 数据库密码
 */
define('DB_PASSWORD','123456');
/**
 * 数据库名字
 */
define('DB_NAME','baixiu');

引入到前台主界面
有define的用require_once

require_once 'config.php';

你可能感兴趣的:(案例练习)