Home  >  Article  >  Backend Development  >  Use XAMPP+WordPress to build a personal blog locally_PHP tutorial

Use XAMPP+WordPress to build a personal blog locally_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:14:331190browse

1. Preparation:

XAMPP is an easy-to-install Apache distribution that includes MySQL, PHP, and Perl. XAMPP is really easy to install and use: just download, unzip, and launch.

So far, there are four versions of XAMPP:

(1) for Linux

(2) for Windows

(3) for Mac OS X

(4) Applies to Solaris

XAMPP is free, you only need to download and unzip XAMPP to complete the installation. Here we use the XAMPP version for Windows. You can download and install the corresponding XAMPP version according to the system you are using.

XAMPP download address: http://www.apachefriends.org/zh_cn/xampp.html

Using WordPress can build a powerful network information publishing platform, but it is more suitable for personalized blogs. For blog applications, WordPress allows you to stop worrying about backend technology and focus on the content of your website

WrodPress requires the support of the following environment:

(1) PHP: 5.2.4 or later

(2) MySQL: 5.0 or later

(3) Apache mod rewrite module (optional, used to support "fixed link" and "site network" functions)

Of course, here we use XAMPP with WordPress. We don’t need to configure PHP and install MySQl and Apache environments. We only need to install XAMPP to support the construction of WrodPress.

WrodPress download address: https://cn.wordpress.org/

2. Environment setup:

The preparation work is completed, let’s start setting up the environment:

We use the downloaded XAMPP installation package to install it. The installation process is very simple, so I won’t go into details here. I believe everyone will install it, haha. The following is the XAMPP program to start after the installation is complete:

As shown above: The newly installed programs are all displayed as red crosses in the Service column because the corresponding services are not installed. You can click on the red crosses to install them. After installation, the red cross will turn into a green tick accordingly.

At this time you can start the Apache and MySQL services.

Pay special attention here. If you have installed IIS related services on your computer, Apache will prompt that port 443 and port 80 are occupied. The reason is that IIS occupies these two ports. What should you do at this time? ? Click the Config button corresponding to the Apache row:


Click Apache (httpd.conf) to open the Apache configuration file, and change the 80 that appears in the file to 801 (or an unoccupied port number is also acceptable).

Click Apache (httpd-ssl.conf) to open the Apache configuration file and change the 443 that appears in the file to 448 (or an unoccupied port number is also acceptable)

At this time, click the Start button to enable the service. You will find that the service can be enabled normally.
At this point, our environment is basically set up.

3. Environment configuration:

The idea behind XAMPP is for those who want to enter Developers in the Apache world offer a set of distributions that are easy to install. For the convenience of developers, XAMPP is configured by default to enable all functions.

The default configuration is not ideal from a security perspective and is not safe enough for production environments - do not use in such environments XAMPP.

Click the Admin button on the Apache line in the XAMPP program to enter the configuration.

For the information here, this article only introduces the [Security] configuration. Friends can learn about other information by themselves.

After clicking [Security], you will be directed to the page http://localhost:801/security/index.php. This page provides a quick overview of the security status of XAMPP after installation.:

Click the link marked in red in the picture above to enter the security console, where you can set the security settings for MySQL and XAMPP directory protection settings. On the page, we set the root user's access password for MySQL. There are also users and passwords for XAMPP directory access.

After setting up, let’s test whether the set user password is correct.

(1). First, let’s verify the user and password for AMPP directory access. Refresh the page and the following page will pop up (because the XAMPP directory is protected, a username and password are required for access):

Fill in the username and password set previously and confirm. If it can be accessed normally, it means that the user and password for AMPP directory access have taken effect.

(2). Next, let’s verify the MySQL database password.

Click the [CD Collection] link on the http://localhost:801/xampp/ page. If the following appears, the password has taken effect:

We need to make changes to the database password in the file. We found H:xampphtdocsxamppcds.php (the test directory for this article is this, friends can modify it according to their own circumstances). Open and find

The default password here is empty. We change it to the database password we set earlier. (Note that there are two places in this file that need to be modified. Please modify both of them to facilitate testing). After modification, save it. At this time, we return to the previous page and reopen the [CD Collection] page. The verification has been successful. As follows:

At this point, we have verified the user and password for AMPP directory access and the MySQL database password.

4. MySQLDatabase management:

(1), phpMyAdmin is a set of PHP programs that can be used to manage MySQL-server and a single database. For those who are not familiar with MySQL It is a very convenient management tool for people who use command line commands

Enter http://localhost:801/phpmyadmin/ in the browser to enter the phpMyAdmin management background to manage MySQL management. The specific how to operate and how to configure it in depth will not be detailed in this article. Friends can study it. Only by studying, studying and operating can we make progress.

(2) After logging in with the MySQL user password set previously, we switch to [Database] and create a new database. In order to build WordPress below, we will create a database named WordPress here.

5. WrodPressStart:

(1). Unzip the downloaded WrodPress file and place it in the directory H:xampphtdocs (the directory depends on each situation). We have already set up the Apache and MySql environments before, so we will complete some WordPress configurations before accessing them.

(2). There are two ways to configure WordPress. One is to manually modify the file for configuration, and the other is to complete the configuration through the wizard provided by WordPress.

a): Open the wp-config-sample.php file in the wordpress folder. This file is a sample configuration file provided by WordPress. We can make other modifications and save it as wp-config.php. This configuration is completed manually. Through this file we can configure [database name] [database user name] [database password] [host] and so on.

b): If you are not familiar with the configuration file, we can configure it through the wizard. Type http://localhost:801/wordpress/ in the browser. If not configured, WordPress will provide a configuration wizard.

The wizard configures [database name] [database username] [database password] [host], (note that the database name here is the WordPress database we created earlier. If it has not been created, the wizard will prompt you to create it first. Database operation.) At the same time, the database will be generated, as well as some site information, background login users, login passwords, etc.

Okay, finish the previous work. Next let’s visit our site:

Front desk: http://localhost:801/wordpress/

Backend: http://localhost:801/wordpress/wp-login.php

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440274.htmlTechArticle1. Preparation: XAMPP is an Apache distribution that is easy to install and includes MySQL, PHP and Perl. XAMPP is really easy to install and use: just download, unzip, launch...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn