企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 百度云虚拟主机 ## 百度虚拟主机安装 - 切换PHP版本,PHP版本必须大于等于7.2 ![](https://img.kancloud.cn/ad/7c/ad7c04a1d21dcf74912ce84cf10ba479_829x854.png) - 下载解压 1. 用FTP把项目存放到webroot目录下即可 2. 确保runtime目录有读写权限 3. webroot目录下的index.html删除掉。 ![](https://img.kancloud.cn/72/0b/720ba5786f61e87f69d81faa8147864a_243x503.png) - 配置nginx,在webroot目录下创建**bcloud\_nginx\_user.conf**文件,复制以下代码保存文件。 这一步主要目的是配置到public 目录下,而**有些虚拟主机商有直接提供后台配置到public目录下,从而并不需要配置**。 ``` <pre class="calibre16">``` location <span class="token">/</span> <span class="token1">{</span> root <span class="token">/</span>home<span class="token">/</span>bae<span class="token">/</span>app<span class="token">/</span>public<span class="token">/</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span><span class="token">-</span>e $request_filename<span class="token1">)</span><span class="token1">{</span> rewrite <span class="token">^</span><span class="token1">(</span><span class="token1">.</span><span class="token">*</span><span class="token1">)</span>$ <span class="token">/</span>index<span class="token1">.</span>php<span class="token">?</span>s<span class="token">=</span>$<span class="token3">1</span> last<span class="token1">;</span> <span class="token2">break</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> location <span class="token">~</span> <span class="token1">.</span>php <span class="token1">{</span> root <span class="token">/</span>home<span class="token">/</span>bae<span class="token">/</span>app<span class="token">/</span>public<span class="token">/</span><span class="token1">;</span> set $path_info <span class="token4">""</span><span class="token1">;</span> set $real_script_name $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 $real_script_name $<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_pass <span class="token3">127.0</span><span class="token3">.0</span><span class="token3">.1</span><span class="token1">:</span><span class="token3">9000</span><span class="token1">;</span> fastcgi_index index<span class="token1">.</span>php<span class="token1">;</span> fastcgi_param SCRIPT_FILENAME $document_root$real_script_name<span class="token1">;</span> fastcgi_param SCRIPT_NAME $real_script_name<span class="token1">;</span> fastcgi_param PATH_INFO $path_info<span class="token1">;</span> fastcgi_param SERVER_PORT <span class="token3">80</span><span class="token1">;</span> include fastcgi_params<span class="token1">;</span> <span class="token1">}</span> ``` ``` - 配置完以上步骤,进行重启站点服务。 ![](https://img.kancloud.cn/bb/10/bb105760e3eaf7554af42fdfdcf7ef93_1332x653.png) - 之后找到你的数据库连接信息,在安装页配置进去即可