Of course. Let's break down the tel setting in the global.cfg file for DedeCMS (织梦CMS).

What is global.cfg?
First, it's important to clarify the file name. In DedeCMS, the main configuration file is typically named config_inc.php, not global.cfg. The global.cfg file you're referring to is likely the dede/config.cache.inc.php file.
This file is automatically generated by DedeCMS and contains cached configuration settings from the system's main configuration panel. It is read-only and should never be edited directly. Any changes you need to make should be done through the DedeCMS backend administration panel.
What is the cfg_tel Setting?
The cfg_tel variable in this file stores the primary contact telephone number for your website. This information is used in various parts of the site, most commonly in the website's footer.
How to Change the cfg_tel Value (The Correct Way)
You should never edit config.cache.inc.php by hand because your changes will be overwritten the next time the system cache is updated.

Follow these steps to change the phone number correctly through the DedeCMS admin panel:
- Log in to your DedeCMS backend.
- Navigate to "System" (系统) in the main menu.
- Select "System Basic Parameters" (系统基本参数).
- On the "Basic Parameters" (基本参数) page, find the "Website Info" (网站信息) section.
- Look for the field named "Contact Tel" (联系电话).
- Enter your desired phone number in this field.
- Scroll down to the bottom of the page and click the "Save" (保存) button.
After saving, DedeCMS will automatically update the config.cache.inc.php file in the dede directory with your new value.
Where is the cfg_tel Value Used?
Once you set the phone number in the backend, it will appear on your website wherever the template code calls for it. The most common place is the footer.
To display the phone number in your template files (e.g., footer.htm), you would use the DedeCMS global variable:

{dede:global.cfg_tel/}
Example in a Footer Template (footer.htm):
<footer>
<div class="container">
<p>Copyright © 2025 Your Company Name. All Rights Reserved.</p>
<p>Contact Us: {dede:global.cfg_tel/} | Email: info@yourcompany.com</p>
</div>
</footer>
When the page is loaded, {dede:global.cfg_tel/} will be replaced with the actual phone number you set in the admin panel.
Security Warning: The cfg_dbpwd Issue
It's very important to mention that the config.cache.inc.php file also contains sensitive information, most notably your database password (cfg_dbpwd).
Because this file is world-readable by default on a web server, it can be a security risk if your site is not properly secured.
How to improve security:
-
Restrict File Permissions: Set the permissions of
config.cache.inc.phpso that it is only readable by the web server user and not by the public. A common permission setting is640.- On Linux:
chmod 640 /path/to/your/dede/config.cache.inc.php
- On Linux:
-
Use
.htaccess(for Apache): You can add the following lines to your website's root.htaccessfile to prevent direct access to the file.<Files "config.cache.inc.php"> Order allow,deny Deny from all </Files> -
Use
web.config(for IIS): You can add a rule in yourweb.configfile to block access to the file.<system.webServer> <security> <requestFiltering> <hiddenSegments> <add segment="dede/config.cache.inc.php" /> </hiddenSegments> </requestFiltering> </security> </system.webServer>
Summary
| Item | Description |
|---|---|
| File Name | dede/config.cache.inc.php (not global.cfg) |
| Variable | $cfg_tel |
| Purpose | Stores the website's main contact phone number. |
| How to Change | Do not edit the file directly. Go to System > System Basic Parameters and edit the "Contact Tel" field. |
| How to Use | In templates, use {dede:global.cfg_tel/} to display the number. |
| Security | This file contains sensitive data like the database password. Secure it by restricting its permissions. |
