当前位置:网站首页>建立自己的网站(14)
建立自己的网站(14)
2022-06-24 19:02:00 【probezy】
在上篇文章中,我们在本地电脑中安装了修改WordPress运行文件所需的VS Code软件,让我们能对WordPress的运行文件进行修改,使其能在远端访客访问时,正确指向我们本地的网页。需要注意的是,由于这篇介绍涉及到修改软件运行文档,因此必须十分小心,防止错改和漏改。话不多说,让我们看看应该如何修改软件运行文档吧。
首先打开VS Code软件,在软件上方任务栏选择“打开文件夹”,依据WordPress的安装路径,找到wp-config.php文件。此处有个小技巧,如果系统未能显示所有文件的扩展名,则可以在文件夹上方的“查看”选项中,将“文件扩展名”勾选,就能显示出文件的扩展名。

在这个例子里,由于我们的WordPress网站中所有文件,已经粘贴到PHPStudy的WWW文件夹中,因此我们需要以这个路径,找到WordPress的配置文件。

接着,我们使用VS Code打开wp-config.php文件,在图示位置插入命令行,教会WordPress将公网访问引导到向外展示的URL上。在初次使用VS Code打开文件时,会弹出权限询问框,我们只要选择对应权限即可。

打开后的wp-config.php文件,看起来是这个样子的

这样看起来,已经很有程序员的范儿了~不过需要注意的是,这个文件是WordPress正常运行的基础,因此千万不能胡乱进行修改,只要找到我们需要修改的部分添加代码即可。
首先,我们需要添加的代码为以下所示(由于输入的代码对于大小写和符号都有要求,因此建议直接复制粘贴)
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);而插入位置,则如下图所示:

修改完成后,则是这个样子的

在修改完成后,我们选择左上角的“文件”选项,点击“保存”即可。

此时我们的WordPress就能对其他访客的访问申请,做出正确的反应了。当然,我们的网站还没有设置相应的输出端口,也没有建立对应的域名,因此本机以外的访客还不能正确的访问到我们的网页。而这些内容,我们会在之后的介绍中,继续为大家说明。如果您对cpolar有任何疑问,欢迎与我们联系,我们必将为您提供力所能及的协助。当然也欢迎vip客户加入cpolar官方群,共同探索cpolar的无限潜能。
边栏推荐
- 苹果、微软、谷歌不再掐架,今年要合力干一件大事
- Teach you how to cancel computer hibernation
- Making startup U disk -- Chinese cabbage U disk startup disk making tool V5.1
- IP address to integer
- Predicate
- RF_ DC system clock setting gen1/gen2
- R for Data Science (notes) -- data transformation (used by filter)
- Hutool reads large excel (over 10m) files
- 【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习
- Vs2017 add header file path method
猜你喜欢

天天鉴宝暴雷背后:拖欠数千万、APP停摆,创始人预谋跑路?

程序员大部分时间不是写代码,而是。。。

技术实现 | Apache Doris 冷热数据存储(一)

Why is the executor thread pool framework introduced

STM32 uses time delay to realize breathing lamp register version

一次 MySQL 误操作导致的事故,高可用都不顶不住!

Error in Android connection database query statement

Example analysis of corrplot related heat map beautification in R language

Geoscience remote sensing data collection online

R for Data Science (notes) -- data transformation (used by filter)
随机推荐
Instruction rearrangement concept
STM32 uses time delay to realize breathing lamp register version
Showcase是什么?Showcase需要注意什么?
The difference between the lazy man mode and the hungry man mode
Todesk remote control, detailed introduction and tutorial
Confirm whether the host is a large terminal or a small terminal
《梦华录》“超点”,鹅被骂冤吗?
Why is the executor thread pool framework introduced
SaltStack State状态文件配置实例
The efficiency of okcc call center data operation
Ribbon源码分析之@LoadBalanced与LoadBalancerClient
Where are Xiaomi mobile phone's favorite SMS and how to delete them
[cann document express issue 04] unveiling the development of shengteng cann operator
LCD1602 string display (STM32F103)
Two solutions to the problem of 0xv0000225 unable to start the computer
Data backup and recovery of PgSQL
[cann document express issue 05] let you know what operators are
[cloud resident co creation] ModelBox draws your own painting across the air
PHP OSS file reads and writes files, and workman generates temporary files and outputs them to the browser for download
【CANN文档速递06期】初识TBE DSL算子开发