企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# Windows下宝塔安装 ## 安装宝塔 打开[链接](https://www.bt.cn/new/download.html) ,下载windows宝塔,双击安装即可。 ## 安装PHP环境 登录宝塔后台,会弹出推荐安装的集成环境,这里选择了Nginx环境。环境要求PHP>=7.2,MySql>=5.6 ## 安装系统 1. 上传HkCms安装包,并解压文件 ![](https://img.kancloud.cn/80/d6/80d6b5cbd21405ecfa930269099497d9_917x589.png) 2. 新建站点 ![](https://img.kancloud.cn/a9/e0/a9e0189a13671b544fb298315f2afe82_854x564.png) 3. 配置目录 站点创建后,点击设置,配置运行目录 ![](https://img.kancloud.cn/af/83/af8360ffca5ab9153af2e96d5daab313_882x555.png) 4. 开启伪静态 下拉选择后点保存 ![](https://img.kancloud.cn/8e/f4/8ef41e202f8fb2031de4359d52aa1d94_716x490.png) 5. 更改Nginx默认的path\_info设置 默认的设置是没法访问 index.php/ceshi/ceshi 这种地址,配置文件路径如下,注意看你安装的位置以及使用的PHP版本,例如PHP7.3是73.conf,以下仅供参考 ``` <pre class="calibre16">``` D<span class="token1">:</span><span class="token">/</span>BtSoft<span class="token">/</span>nginx<span class="token">/</span>conf<span class="token">/</span>php<span class="token">/</span><span class="token3">72.</span>conf ``` ``` 配置文件内容如下 ``` <pre class="calibre16">``` location <span class="token">~</span> \<span class="token1">.</span><span class="token6">php</span><span class="token1">(</span><span class="token1">.</span><span class="token">*</span><span class="token1">)</span>$ <span class="token1">{</span> try_files $uri <span class="token">=</span><span class="token3">404</span><span class="token1">;</span> fastcgi_pass <span class="token3">127.0</span><span class="token3">.0</span><span class="token3">.1</span><span class="token1">:</span><span class="token3">20072</span><span class="token1">;</span> fastcgi_index index<span class="token1">.</span>php<span class="token1">;</span> fastcgi_split_path_info <span class="token">^</span><span class="token1">(</span><span class="token1">(</span><span class="token">?</span>U<span class="token1">)</span><span class="token1">.</span><span class="token">+</span>\<span class="token1">.</span>php<span class="token1">)</span><span class="token1">(</span><span class="token">/</span><span class="token">?</span><span class="token1">.</span><span class="token">+</span><span class="token1">)</span>$<span class="token1">;</span> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name<span class="token1">;</span> fastcgi_param PATH_INFO $fastcgi_path_info<span class="token1">;</span> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name<span class="token1">;</span> include fastcgi_params<span class="token1">;</span> <span class="token1">}</span> ``` ``` **修改后的配置**,fastcgi\_pass不用动,看效果图,主要是删掉那4行,增加以下代码 ``` <pre class="calibre16">``` location <span class="token">~</span> \<span class="token1">.</span><span class="token6">php</span><span class="token1">(</span><span class="token1">.</span><span class="token">*</span><span class="token1">)</span>$ <span class="token1">{</span> try_files $uri <span class="token">=</span><span class="token3">404</span><span class="token1">;</span> fastcgi_pass <span class="token3">127.0</span><span class="token3">.0</span><span class="token3">.1</span><span class="token1">:</span><span class="token3">20072</span><span class="token1">;</span> fastcgi_index index<span class="token1">.</span>php<span class="token1">;</span> set $fastcgi_script_name2 $fastcgi_script_name<span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span>$fastcgi_script_name <span class="token">~</span> <span class="token4">"^(.+\.php)(/.+)$"</span><span class="token1">)</span> <span class="token1">{</span> set $fastcgi_script_name2 $<span class="token3">1</span><span class="token1">;</span> set $path_info $<span class="token3">2</span><span class="token1">;</span> <span class="token1">}</span> fastcgi_param PATH_INFO $path_info<span class="token1">;</span> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2<span class="token1">;</span> fastcgi_param SCRIPT_NAME $fastcgi_script_name2<span class="token1">;</span> include fastcgi_params<span class="token1">;</span> <span class="token1">}</span> ``` ``` 效果图 ![](https://img.kancloud.cn/f3/74/f3748e0fc5d10fb9ee20ebb9f28397d9_741x433.png) 6. 重启服务 ![](https://img.kancloud.cn/ec/b6/ecb6ed0ae2822831d83e721b77fe4fc4_588x338.png) 然后输入你的域名即可体验HkCms系统的安装了。