From 6a43cec22e8ba615bd8dc1e36f0583ba340ec5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B1=95=E9=B9=8F?= Date: Fri, 5 Dec 2025 17:06:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=A8=A1=E6=9D=BFconfig.php.env=E5=92=8C=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=96=87=E6=A1=A3INSTALL.md=EF=BC=8C=E4=BB=8EGit?= =?UTF-8?q?=E4=B8=AD=E7=A7=BB=E9=99=A4config.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INSTALL.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ config.php | 7 ---- config.php.env | 16 +++++++++ 3 files changed, 108 insertions(+), 7 deletions(-) create mode 100644 INSTALL.md delete mode 100644 config.php create mode 100644 config.php.env diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..0a6e0bf --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,92 @@ +# 洗车预约系统安装指南 + +## 1. 环境要求 + +- PHP 5.6 或更高版本 +- MySQL 5.5 或更高版本 +- Web服务器(如Apache、Nginx等) + +## 2. 安装步骤 + +### 2.1 克隆项目 + +首先,将项目克隆到您的本地或服务器上: + +```bash +git clone [项目仓库地址] +cd carwash_order +``` + +### 2.2 配置数据库 + +1. 创建数据库: + - 使用MySQL客户端(如phpMyAdmin、Navicat等)创建一个新的数据库 + - 数据库名称建议使用 `carwash_booking` + +2. 导入数据库结构: + - 执行 `carwash_db.sql` 文件,创建所需的表结构和初始数据 + +### 2.3 配置数据库连接 + +1. 复制配置文件模板: + - 将 `config.php.env` 重命名为 `config.php` + +2. 修改数据库连接信息: + - 使用文本编辑器打开 `config.php` 文件 + - 根据您的数据库配置修改以下参数: + +```php +// 数据库主机地址 +$host = 'localhost'; // 通常为localhost,如使用远程数据库请填写IP地址 + +// 数据库用户名 +$username = 'your_username'; // 替换为您的MySQL用户名 + +// 数据库密码 +$password = 'your_password'; // 替换为您的MySQL密码 + +// 数据库名称 +$database = 'carwash_booking'; // 替换为您创建的数据库名称 +``` + +### 2.4 部署到Web服务器 + +- 将项目文件上传到Web服务器的根目录或虚拟主机的文档根目录 +- 确保Web服务器具有对项目文件的读取权限 +- 确保PHP可以执行项目中的PHP文件 + +## 3. 访问系统 + +在浏览器中输入您的域名或IP地址,即可访问洗车预约系统。 + +例如: +``` +http://localhost/carwash_order/ +``` + +## 4. 常见问题 + +### 4.1 数据库连接失败 + +- 检查 `config.php` 文件中的数据库连接信息是否正确 +- 确保MySQL服务正在运行 +- 确保数据库用户具有足够的权限 + +### 4.2 页面显示错误 + +- 检查PHP版本是否符合要求 +- 检查Web服务器的错误日志 +- 确保所有项目文件都已正确上传 + +## 5. 其他配置 + +- 如果您需要修改时区设置,可以在PHP文件中添加:`date_default_timezone_set('Asia/Shanghai');` +- 如果您需要修改会话超时时间,可以在PHP文件中添加:`ini_set('session.gc_maxlifetime', 3600);` + +## 6. 注意事项 + +- 不要将 `config.php` 文件提交到Git仓库,该文件包含敏感的数据库连接信息 +- 定期备份数据库和项目文件 +- 确保使用强密码保护数据库和服务器 + +如有其他问题,请参考项目的README.md文件或联系技术支持。 \ No newline at end of file diff --git a/config.php b/config.php deleted file mode 100644 index 6bfcfc0..0000000 --- a/config.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/config.php.env b/config.php.env new file mode 100644 index 0000000..bf0b78c --- /dev/null +++ b/config.php.env @@ -0,0 +1,16 @@ + \ No newline at end of file