本向导会引导你完成数据库配置与管理员账号创建。
未配置伪静态时,后台、用户中心等页面会 404,支付回调也会失效
请按当前服务器添加下面的规则,保存后再点「重新检测」。检测到当前服务器:nginx/1.31.8
Nginx 不读站点根目录的 .htaccess 和 web.config,规则要加到站点配置或面板的伪静态里(宝塔:网站 → 设置 → 伪静态),保存后重新加载 Nginx。
location ~* ^/content/(uploads|uploadfile|cache|tmp)/.*\.php(/|$) {
return 404;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
.htaccess 已随程序放在站点根目录,正常情况下无需改动。检测不通过时依次确认:mod_rewrite 已启用、站点目录允许覆盖配置(AllowOverride All)、站点在子目录时已配置 RewriteBase。
<IfModule mod_rewrite.c>
RewriteEngine On
# 站点装在子目录(如 /shop/)时取消注释并改成实际目录
# RewriteBase /shop/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>
web.config 已随程序放在站点根目录,但必须先安装 URL Rewrite 模块(未安装时整站会报 500.19);同时确认 PHP 已按 FastCGI 方式接入。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="EMSHOP Rewrite" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
满足以下条件可获得更好的运行与安全体验
建议PHP版本 8.2
建议MySQL版本 5.7
安装过程会写入 config.php 并初始化数据表,请确保网站目录权限为755。