当前位置:网站首页>Set up your own website (14)

Set up your own website (14)

2022-06-24 20:22:00 probezy

In the last article , We installed the modification on the local computer WordPress Required to run the file VS Code Software , Let's be able to WordPress To modify the operation file , So that it can be accessed by remote visitors , Point to our local web page correctly . It should be noted that , Since this introduction involves modifying the software operation documents , So you have to be very careful , Prevent mistakes and omissions . Don't talk much , Let's take a look at how to modify the software operation document .

Start by opening VS Code Software , Select... From the taskbar above the software “ Open folder ”, basis WordPress Installation path for , find wp-config.php file . Here's a tip , If the system fails to display all file extensions , Can be found at the top of the folder “ see ” In the options , take “ File extension ” Check , The extension of the file will be displayed .

In this case , Because of our WordPress All files in the web site , Already pasted to PHPStudy Of WWW In the folder , So we need to take this path , find WordPress Configuration file for .

next , We use VS Code open wp-config.php file , Insert the command line at the position shown , church WordPress Guide the public network access to the outward display URL On . In the first use VS Code When opening a file , A permission query box will pop up , We just need to select the corresponding permission .

After opening wp-config.php file , It looks like this

It looks like this , It already has the style of a programmer ~ But here's the thing , This file is WordPress The basis of normal operation , Therefore, you must not make random changes , Just find the part we need to modify and add the code .

First , The code we need to add is shown below ( As the input code has requirements for case and symbol , Therefore, it is recommended to copy and paste directly )

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

And the insertion position , As shown in the figure below :

After the modification is completed , It's like this

After the modification , We choose the one in the upper left corner “ file ” Options , Click on “ preservation ” that will do .

Now our WordPress You can apply for visits from other visitors , The right response . Of course , Our website has not set up the corresponding output port , There is no corresponding domain name , Therefore, visitors outside the local computer can not correctly access our web page . And these things , We will introduce it later , Continue to explain . If you are right about cpolar Have any questions , Welcome to contact us , We will certainly provide you with assistance within our ability . Of course, you are welcome vip Customer join cpolar Official group , Explore together cpolar The infinite potential of .

原网站

版权声明
本文为[probezy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241352215429.html