跳转到内容
无痕工具库 无痕工具库

Hostinger 网站配置文件位置查找教程

本文介绍如何根据你所使用的 CMS,在 Hostinger 上查找网站的配置文件。

以下指南不适用于使用 Hostinger AI Builder 创建的网站

查找你的配置文件

要查找网站的配置文件,请打开文件管理器并进入 public_html 文件夹。大多数配置文件都位于该文件夹中,因为它是网站的根目录。

网站配置文件的名称因你所使用的 CMS 而异:

CMS文件名文件路径
WordPresswp-config.phppublic_html/wp-config.php
Joomlaconfiguration.phppublic_html/configuration.php
OpenCartconfig.phppublic_html/config.php 以及 public_html/admin/config.php
PrestaShopconfig.inc.php settings.inc.phppublic_html/config/config.inc.php 或旧版本中的 settings.inc.php
phpBBconfig.phppublic_html/config.php
Drupalsettings.phppublic_html/drupal/sites/default/settings.php
Bitrix24.settings.phppublic_html/bitrix/php_interface/dbconn.php 以及 public_html/bitrix/.settings.php
Modxconfig.inc.phppublic_html/manager/includes/config.inc.php
Umi.CMSconfig.inipublic_html/config.ini
ImageCMSdatabase.phppublic_html/application/config/database.php
Simplaconfig.phppublic_html/config/config.php
Piwigodatabase.inc.phppublic_html/local/config/database.inc.php
Shop-Scriptdb.phppublic_html/wa-config/db.php
HostCMSconfig.phppublic_html/modules/core/config/config.php
CS-Cartconfig.local.phppublic_html/config.local.php
LiveStreetconfig.local.phppublic_html/config/config.local.php
Datalife (Dle)dbconfig.phppublic_html/upload/engine/data/dbconfig.php
IPBconf_global.phppublic_html/conf_global.php
Net(Cat).CMSvars.inc.phppublic_html/vars.inc.php
Simple Machines Forumsettings.phppublic_html/settings.php
Dolphinheader.inc.phppublic_html/inc/header.inc.php
CMS Made Simpleconfig.phppublic_html/config.php
InstantCMSconfig.inc.phppublic_html/includes/config.inc.php
Media Wikilocalsettings.phppublic_html/localsettings.php
Zen Cartconfigure.phppublic_html/includes/configure.php
Codeigniterdatabase.phppublic_html/config/database/database.php
OJSconfig.inc.php位于网站根目录
Moodleconfig.php位于网站根目录
Laravel.env位于网站根目录
Magentoenv.phppublic_html/app/etc/env.php
CakePHPapp.phppublic_html/config/app.php
Slimsettings.php取决于客户端配置
Typo3LocalConfiguration.phppublic_html/typo3conf/LocalConfiguration.php
Concrete5concrete.phppublic_html/application/config/concrete.php
October CMS.env位于网站根目录
Expression Engineconfig.phppublic_html/system/ee/installer/config.php
SilverStripe_config.phppublic_html/mysite/_config.php
Codeigniter 4Database.phppublic_html/app/Config/Database.php
Sendy.coconfig.phppublic_html/includes/config.php
Dolibarrconf.phppublic_html/conf/conf.php
Adminerdbhandler.phppublic_html/includes/dbhandler.php
Symfony CMSparameters.ymlpublic_html/app/config/parameters.yml
Cubecartglobal.inc.phppublic_html/includes/global.inc.php
TextPattern CMSconfig.phppublic_html/textpattern/config.php
SuiteCRMconfig.php(root)/public/legacy/config.php

备注

  • 你也可以通过 SSH 查找数据库配置文件。首先,通过 SSH 连接到你的主机方案,然后在网站根目录下运行 grep -irl DB_NAME * 或 grep -irl DB_USER *——请将 DB_NAME 或 DB_USER 替换为你实际的数据库名称或数据库用户名。
  • 如果你使用的是 WordPress 网站,你也可以在此处在 Hostinger 上启用 WP_DEBUG 进行故障排查。

如果你使用的 CMS 未在列表中

如果你使用的是其他 CMS,可以按照以下步骤查找该文件:

  1. 搜索名称中包含 config、conf 或 db 的文件
  2. 检查是否存在诸如 engine、vendor 或 includes 之类的目录
  3. 咨询你的开发者,或查阅针对该 CMS 的论坛