Hostinger 网站配置文件位置查找教程
本文介绍如何根据你所使用的 CMS,在 Hostinger 上查找网站的配置文件。
以下指南不适用于使用 Hostinger AI Builder 创建的网站
查找你的配置文件
要查找网站的配置文件,请打开文件管理器并进入 public_html 文件夹。大多数配置文件都位于该文件夹中,因为它是网站的根目录。
网站配置文件的名称因你所使用的 CMS 而异:
| CMS | 文件名 | 文件路径 |
| WordPress | wp-config.php | public_html/wp-config.php |
| Joomla | configuration.php | public_html/configuration.php |
| OpenCart | config.php | public_html/config.php 以及 public_html/admin/config.php |
| PrestaShop | config.inc.php settings.inc.php | public_html/config/config.inc.php 或旧版本中的 settings.inc.php |
| phpBB | config.php | public_html/config.php |
| Drupal | settings.php | public_html/drupal/sites/default/settings.php |
| Bitrix24 | .settings.php | public_html/bitrix/php_interface/dbconn.php 以及 public_html/bitrix/.settings.php |
| Modx | config.inc.php | public_html/manager/includes/config.inc.php |
| Umi.CMS | config.ini | public_html/config.ini |
| ImageCMS | database.php | public_html/application/config/database.php |
| Simpla | config.php | public_html/config/config.php |
| Piwigo | database.inc.php | public_html/local/config/database.inc.php |
| Shop-Script | db.php | public_html/wa-config/db.php |
| HostCMS | config.php | public_html/modules/core/config/config.php |
| CS-Cart | config.local.php | public_html/config.local.php |
| LiveStreet | config.local.php | public_html/config/config.local.php |
| Datalife (Dle) | dbconfig.php | public_html/upload/engine/data/dbconfig.php |
| IPB | conf_global.php | public_html/conf_global.php |
| Net(Cat).CMS | vars.inc.php | public_html/vars.inc.php |
| Simple Machines Forum | settings.php | public_html/settings.php |
| Dolphin | header.inc.php | public_html/inc/header.inc.php |
| CMS Made Simple | config.php | public_html/config.php |
| InstantCMS | config.inc.php | public_html/includes/config.inc.php |
| Media Wiki | localsettings.php | public_html/localsettings.php |
| Zen Cart | configure.php | public_html/includes/configure.php |
| Codeigniter | database.php | public_html/config/database/database.php |
| OJS | config.inc.php | 位于网站根目录 |
| Moodle | config.php | 位于网站根目录 |
| Laravel | .env | 位于网站根目录 |
| Magento | env.php | public_html/app/etc/env.php |
| CakePHP | app.php | public_html/config/app.php |
| Slim | settings.php | 取决于客户端配置 |
| Typo3 | LocalConfiguration.php | public_html/typo3conf/LocalConfiguration.php |
| Concrete5 | concrete.php | public_html/application/config/concrete.php |
| October CMS | .env | 位于网站根目录 |
| Expression Engine | config.php | public_html/system/ee/installer/config.php |
| SilverStripe | _config.php | public_html/mysite/_config.php |
| Codeigniter 4 | Database.php | public_html/app/Config/Database.php |
| Sendy.co | config.php | public_html/includes/config.php |
| Dolibarr | conf.php | public_html/conf/conf.php |
| Adminer | dbhandler.php | public_html/includes/dbhandler.php |
| Symfony CMS | parameters.yml | public_html/app/config/parameters.yml |
| Cubecart | global.inc.php | public_html/includes/global.inc.php |
| TextPattern CMS | config.php | public_html/textpattern/config.php |
| SuiteCRM | config.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,可以按照以下步骤查找该文件:
- 搜索名称中包含 config、conf 或 db 的文件
- 检查是否存在诸如 engine、vendor 或 includes 之类的目录
- 咨询你的开发者,或查阅针对该 CMS 的论坛