xampp本地_如何使用XAMPP创建本地WordPress网站

xampp本地

Do you want to create a local WordPress site on your computer using XAMPP?

您是否要使用XAMPP在计算机上创建本地WordPress网站?

Installing WordPress on your computer helps you try out WordPress, test themes and plugins, and learn WordPress development.

在计算机上安装WordPress可帮助您试用WordPress,测试主题和插件以及学习WordPress开发。

In this article, we will show you how to easily create a local WordPress site Using XAMPP.

在本文中,我们将向您展示如何使用XAMPP轻松创建本地WordPress网站。

Creating local WordPress install using XAMPP

为什么要创建本地WordPress网站? (Why Create a Local WordPress Site?)

Creating local WordPress sites is a common practice among developers and site owners. It allows you to test WordPress without creating an actual website on the internet.

创建本地WordPress网站是开发人员和网站所有者之间的常见做法。 它可以让您测试WordPress,而无需在互联网上创建实际的网站。

Local websites are only visible to you on your computer. You can try different WordPress themes and plugins, test their features, and learn the WordPress basics.

本地网站仅在您的计算机上可见。 您可以尝试不同的WordPress主题和插件,测试其功能,并学习WordPress基础知识。

If you already have a WordPress website, then you can create a local copy of your website on your computer to try out new plugin updates before implementing them on your live website.

如果您已经拥有WordPress网站 ,则可以在计算机上创建您网站本地副本,以在新插件更新在实时网站上实施之前尝试新的插件更新。

Important: Local website will only be visible to you on your computer. If you want to make a live website, then you’ll need a domain name and WordPress hosting.

重要提示:只有您在计算机上才能看到本地网站。 如果您想制作一个实时网站,则需要一个域名WordPress托管

Follow the step by step instructions in our how to start a WordPress blog guide when you are ready to create a live website.

准备好创建实时网站时,请按照我们如何启动WordPress博客指南中的分步说明进行操作。

Having said that, let’s check out how to install WordPress locally on Windows, Mac, or Linux using XAMPP.

话虽如此,让我们看看如何使用XAMPP在Windows,Mac或Linux上本地安装WordPress。

什么是XAMPP? (What is XAMPP?)

XAMPP is a software package that includes all things you need to set up a local server environment on your computer.

XAMPP是一个软件包,其中包括在计算机上设置本地服务器环境所需的所有内容。

In order to create a local WordPress site, you need to set up a web server software (Apache), PHP, and MySQL on your computer.

为了创建本地WordPress网站,您需要在计算机上设置Web服务器软件(Apache),PHP和MySQL。

PHP is a programming language and MySQL is a database management software. Both of them are required to run WordPress.

PHP是一种编程语言,而MySQL是一种数据库管理软件。 两者都需要运行WordPress。

Installing each of them separately is quite difficult for beginners. This is where XAMPP comes in.

对于初学者来说,分别安装它们非常困难。 这就是XAMPP出现的地方。

XAMPP makes it easy for you to build WordPress websites locally. It is available for Windows, Mac, and Linux based computers.

XAMPP使您可以轻松地在本地构建WordPress网站。 它适用于基于Windows,Mac和Linux的计算机。

Let’s get started by installing XAMPP and setting it up to run your local WordPress site.

让我们开始安装XAMPP并将其设置为运行本地WordPress网站。

在计算机上安装XAMPP (Installing XAMPP on Your Computer)

First, you need to visit the XAMPP website and click on the download button for your operating system.

首先,您需要访问XAMPP网站并单击操作系统的下载按钮。

Download XAMPP to your computer

Depending on your operating system, your installation wizard and the application interface may differ from the screenshots here. For the sake of this article, we’ll show you the Windows version of the software.

根据您的操作系统,安装向导和应用程序界面可能与此处的屏幕截图有所不同。 为了本文的方便,我们将向您展示该软件的Windows版本。

After downloading XAMPP, you will need to click and run the installer.

下载XAMPP之后,您需要单击并运行安装程序。

XAMPP set up wizard

XAMPP will ask where to install the software and which packages you’d like to install. The default settings will work for most users. Keep clicking on the ‘Next’ button to finish the setup wizard.

XAMPP将询问在何处安装该软件以及您想要安装哪些软件包。 默认设置适用于大多数用户。 继续单击“下一步”按钮以完成设置向导。

After finishing the wizard, check the ‘start the control panel now’ option and then click on the finish button.

完成向导后,选中“立即启动控制面板”选项,然后单击完成按钮。

Finish set up and launch XAMPP control panel

This will launch the XAMPP control panel app.

这将启动XAMPP控制面板应用程序。

Using the XAMPP app, you can run Apache web server as your local server and MySQL as your database server. Go ahead and click on the start button next to both Apache and MySQL.

使用XAMPP应用程序,您可以将Apache Web服务器作为本地服务器运行,而将MySQL作为数据库服务器运行。 继续并单击Apache和MySQL旁边的开始按钮。

Start Apache and MySQL to launch your local server

XAMPP will now start Apache and MySQL. You may see a Windows firewall notification, it is important that you click on the ‘Allow Access’ button for both applications to run on your computer.

XAMPP现在将启动Apache和MySQL。 您可能会看到Windows防火墙通知,请务必单击“允许访问”按钮,以使这两个应用程序都可以在计算机上运行。

Allow firewall access to Apache and MySQL

Once both applications are started their names will be highlighted in Green.

两个应用程序启动后,其名称将以绿色突出显示。

Now you are ready to create a local website and install WordPress using XAMPP.

现在,您准备创建本地网站并使用XAMPP安装WordPress。

使用XAMPP创建本地WordPress网站 (Creating a Local WordPress Site with XAMPP)

First, you will need to download WordPress. Visit the WordPress.org website and click on the ‘Download WordPress’ button.

首先,您将需要下载WordPress。 访问WordPress.org网站,然后单击“下载WordPress”按钮。

Download WordPress

After downloading WordPress, you need to extract the zip file, and you will see a wordpress folder. You need to copy this folder.

下载WordPress之后,您需要解压缩zip文件,然后会看到一个wordpress文件夹。 您需要复制此文件夹。

WordPress folder

Next, head over to your XAMPP installation folder.

接下来,转到您的XAMPP安装文件夹。

On Windows it would be C:/Program Files/XAMPP/htdocs or C:/Xampp/htdocs folder.

在Windows上,它将是C:/Program Files/XAMPP/htdocsC:/Xampp/htdocs文件夹。

On Mac, it will be /Applications/XAMPP/htdocs folder.

在Mac上,它将是/Applications/XAMPP/htdocs文件夹。

Paste the wordpress folder you copied earlier inside htdocs.

将您先前复制的wordpress文件夹粘贴到htdocs中。

We recommend renaming the wordpress folder to websites or anything else. This will help you easily identify your local site.

我们建议将wordpress文件夹重命名为网站或其他任何名称。 这将帮助您轻松识别本地站点。

Rename WordPress folder

Next, you need to open your favorite web browser and enter the following URL in your browser’s address bar.

接下来,您需要打开自己喜欢的Web浏览器,然后在浏览器的地址栏中输入以下URL。

https://localhost/website1/

https:// localhost / website1 /

If you renamed the WordPress folder something else, then replace website1 with your own folder name.

如果您将WordPress文件夹重命名为其他名称,请用您自己的文件夹名称替换website1。

This will load the WordPress installation wizard and you’ll be asked to select a language. After selecting a language, click on the ‘Continue’ button.

这将加载WordPress安装向导,并要求您选择一种语言。 选择一种语言后,单击“继续”按钮。

Select language

On the next screen, you will see a notice that WordPress needs a database name, database username, password, and host information.

在下一个屏幕上,您会看到一个通知,WordPress需要数据库名称,数据库用户名,密码和主机信息。

WordPress installation requirements

Let’s create a database for your WordPress site.

让我们为您的WordPress网站创建一个数据库。

You’ll need to open a new browser tab and visit https://localhost/phpmyadmin/.

您需要打开一个新的浏览器选项卡并访问https:// localhost / phpmyadmin /。

This will launch the phpMyAdmin app that comes pre-installed with XAMPP. It allows you to easily manage your databases using a simpler interface.

这将启动XAMPP预先安装的phpMyAdmin应用程序。 它使您可以使用更简单的界面轻松管理数据库

You would need to click on Databases, and provide a name for your new database. After that, click on the ‘Create’ button to continue.

您需要单击数据库,并为新数据库提供一个名称。 之后,点击“创建”按钮继续。

Creating a database for your local WordPress site

Now that you have created a database, you can use it for your WordPress site.

现在,您已经创建了数据库,可以将其用于WordPress网站。

Switch back to /localhost/website1/ browser tab and click on the ‘Let’s Go’ button.

切换回/ localhost / website1 /浏览器选项卡,然后单击“ Let's Go”按钮。

On the next screen, you will be asked to provide your WordPress database information.

在下一个屏幕上,将要求您提供WordPress数据库信息。

Enter the database name you created earlier. Your username is ‘root’ and you should leave the password field blank. For the database host field, you need to use localhost.

输入您先前创建的数据库名称。 您的用户名是“ root”,您应该将密码字段留空。 对于数据库主机字段,您需要使用localhost。

Enter your WordPress database information

Once you are done, click on the ‘Submit’ button to continue.

完成后,单击“提交”按钮继续。

If you are on Windows or Linux, WordPress will now store these settings in your WordPress configuration file called wp-config.php file.

如果您使用的是Windows或Linux,WordPress现在会将这些设置存储在名为wp-config.php的 WordPress配置文件中。

However, if you are on Mac, then it will show you the contents of the file and will ask you to create it.

但是,如果您使用的是Mac,则它将显示文件内容并要求您创建文件。

You will need to create this file in your website’s root folder.

您将需要在网站的根文件夹中创建此文件。

After creating the file, paste the text you copied earlier inside it. Next, you need to save the file and return back to WordPress installer to continue.

创建文件后,将先前复制的文本粘贴到文件中。 接下来,您需要保存文件并返回WordPress安装程序以继续。

In the next step, WordPress will ask you to provide information about your website. First, enter the title you want to use for this site.

下一步,WordPress将要求您提供有关您的网站的信息。 首先,输入要用于此站点的标题。

After that, you need to enter a username, password, and email address for your admin account.

之后,您需要输入管理员帐户的用户名,密码和电子邮件地址。

Enter your local site information

Once you have filled all the information, click on the ‘Install WordPress’ button to continue.

填写完所有信息后,单击“安装WordPress”按钮继续。

WordPress will now run the installation and prompt you to log in once it’s done.

WordPress现在将运行安装并在完成后提示您登录。

You can login to your website by going to /localhost/website1/wp-admin page and use the username / password that you entered during installation to login.

您可以转到/localhost/website1/wp-admin页面登录到您的网站,并使用在安装过程中输入的用户名/密码登录。

WordPress login page

创建本地WordPress网站后要尝试的事情 (Things to Try After Creating a Local WordPress Site)

Now that you have created your local WordPress site using XAMPP, you can work on it like you would do on a live WordPress site.

现在,您已经使用XAMPP创建了本地WordPress网站,就可以像在实时WordPress网站上那样在其上进行操作。

Head over to Appearance menu in WordPress admin sidebar, to customize your site’s appearance or install a new theme.

转到WordPress管理侧边栏中的外观菜单,以自定义网站的外观或安装新主题

Here are some great free themes that you can try.

这里有一些很棒的免费主题 ,您可以尝试。

The next thing you would want to try is WordPress plugins.

接下来要尝试的是WordPress插件

Plugins are like apps for your WordPress site and allow you to add cool features like contact form, social media buttons, eCommerce store, etc.

插件就像您的WordPress网站的应用程序一样,可让您添加很酷的功能,例如联系表单社交媒体按钮电子商务商店等。

Need help installing plugins? See our step by step guide on how to install a WordPress plugin.

需要安装插件的帮助吗? 请参阅有关如何安装WordPress插件的分步指南。

奖励:将本地WordPress网站移至L​​ive Server (Bonus: Moving Local WordPress Site to Live Server)

After working on your local WordPress site you may want to move it to a live server to make your first WordPress blog or website.

在您本地的WordPress网站上工作后,您可能需要将其移至实时服务器以创建您的第一个WordPress博客或网站。

To do that you’ll need a domain name and web hosting account. Normally, a domain name costs $14.99 and website hosting start from $7.99 per month.

为此,您需要一个域名和虚拟主机帐户。 通常,域名的价格为14.99美元,网站托管的价格为每月7.99美元。

That’s too much if you are just starting out.

如果您刚开始,那么太多了。

Luckily, Bluehost is offering WPBeginner users a free domain name with generous discount on hosting. Basically, you can get started for $2.75 per month.

幸运的是, Bluehost为WPBeginner用户提供了一个免费域名,可以免费享受托管费用。 基本上,您每月只需支付2.75美元即可开始使用。

→ Click Here to Claim This Exclusive Bluehost Offer ←

→单击此处要求此Bluehost独家优惠←

For more hosting recommendations, take a look at our complete WordPress hosting guide.

有关更多托管建议,请查看我们完整的WordPress托管指南

Once you have signed up for hosting, you can follow our step by step guide on how to move WordPress from local server to live site.

注册托管后,您可以按照我们的逐步指南进行操作,以了解如何将WordPress从本地服务器移动到实时站点

We hope this article helped you learn how to create a local WordPress site using XAMPP. You may also want to look at alternate ways to create local WordPress sites on Windows using Wampserver, and on Mac using MAMP.

我们希望本文能帮助您学习如何使用XAMPP创建本地WordPress网站。 您可能还想看看在Windows上使用Wampserver以及在Mac上使用MAMP创建本地WordPress网站的替代方法。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-create-a-local-wordpress-site-using-xampp/

xampp本地

  • 1
    点赞
  • 1
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:编程工作室 设计师:CSDN官方博客 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值