# hf-php **Repository Path**: zy19921217/hf-php ## Basic Information - **Project Name**: hf-php - **Description**: hf-php - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-01 - **Last Updated**: 2025-08-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 介绍 Hcms 是一个基于 [Hyperf](https://hyperf.io/) 框架的项目开发管理系统 , 在Hyperf超高速且灵活的特性加持下,构建一个快速开发、模块复用的项目开发管理系统。 # 依赖 - PHP >= 8.1 - Swoole PHP extension >= 5.0,and Disabled `Short Name` - OpenSSL PHP extension - JSON PHP extension - PDO PHP extension - Redis PHP extension # 安装 - composer 创建项目 ```shell composer create-project zhlhuang/hcms ``` - 配置 .env 数据库和Redis ``` APP_NAME=hcms APP_ENV=dev SCAN_CACHEABLE=false DB_DRIVER=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=hcms DB_USERNAME=root DB_PASSWORD= DB_CHARSET=utf8mb4 DB_COLLATION=utf8mb4_unicode_ci DB_PREFIX= REDIS_HOST=localhost REDIS_AUTH=(null) REDIS_PORT=6379 REDIS_DB=0 ``` - 执行hcms安装 Admin 模块 ```shell php bin/hyperf.php hcms:install admin ``` # 启动 ```shell composer start //开发启动 composer watch ``` # 访问 访问 `http://127.0.0.1:9501/admin/index/index` 默认管理的账号是 admin、密码是 123123 # 文档 [https://www.yuque.com/huangzhenlian/hcms](https://www.yuque.com/huangzhenlian/hcms) # 模块扩展 [https://github.com/hcms-module](https://github.com/hcms-module) #查看进程 netstat -anp | grep 9501 #删除进程 kill -9 78954 #启动 php bin/hyperf.php start php bin/hyperf.php server:watch #代码不生效 composer dump-autoload -o #sql调试语句 $lists = Package::where($where) ->toRawSql(); 先配置ssl 在配置反向代理 #反向代理问题 开始 upstream hyperf { #PROXY-START/ location ^~ / { proxy_pass http://47.120.23.131:9501/; proxy_set_header Host https://zly.qile168.net/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; # proxy_hide_header Upgrade; add_header X-Cache $upstream_cache_status; #Set Nginx Cache # 增加 X-Forwarded-Proto 来存真正的 scheme proxy_set_header X-Forwarded-Proto $scheme; # 转发Cookie,设置 SameSite proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict"; set $static_filebt6c202f 0; if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" ) { set $static_filebt6c202f 1; expires 1m; } if ( $static_filebt6c202f = 0 ) { add_header Cache-Control no-cache; } } #PROXY-END/ 1.反向代理问题 结束 proxy_cookie_path 如果没有部署https 需要将 proxy_cookie_path中的 secure删除,否则会导致session错误,登录验证码错误。