The whole process record _php instance of WordPress blog built from scratch on CentOS system

Source: Internet
Author: User
Tags install php mysql host save file create database wordpress blog

Overview

Recently bought a server, ready to build a personal blog, to continue to update their blog,

Environment

    • Server operating system: CentOS 7.0
    • Blog Deployment server: Apache
    • Background language: PHP
    • Database: MYSQL
    • Front End frame: WordPress

Steps

First, install Apache

It's easy to install Apache simply by typing the following command on the terminal:

sudo yum install httpd

sudo means what to do with the root user, yum install is installed online, and then enter Yes to confirm the download installation.

We need to start the service after the installation is complete:

sudo service httpd start

When the boot server completes, do not hurry down, you can enter the server's IP address directly in the browser, you should be able to see the Apache Welcome page.

This page was used to test the operation of the Apache HTTP server after it has been installed ... Wait a minute

If your IP address has been bound to the domain name, then enter your domain name in the browser can also be accessed, is not cool, it is so simple, we continue.

Second, the installation of MYSQL

Install MySQL, and start MySQL

sudo yum install mysql-server
 
sudo service mysqld start

Through the above command can install and start MySQL, install MySQL will ask you some simple configuration, enter enter and yes all the way down OK.

Third, the installation of PHP and related PHP components

Install PHP First

sudo yum install php php-mysql

Installing PHP-related components

Yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

I first installed these components, for later use, you want to know all the PHP components, you can use the following command to search:

Yum Search php-

Four, the boot default start Apache and Mysql services

You can choose to boot up Apache and Mysql using the following command:

sudo chkconfig http on

sudo chkconfig MySQL on

Test whether PHP is installed successfully

Create a info.php file:

sudo vim/var/www/html/info.php

Then enter I into edit mode and write the following PHP command in the file:

<?php
phpinfo ();
? >

Then press ESC to enter command mode, press the Shift key and two times Z to exit the save file.

Enter the IP address/info.php in the browser, for example: 123.56.183.34/info.php carriage return, you can see the information of PHP.

Six, download WordPress

You can go to the https://wordpress.org/Web site, or through the following command to download:

wget Http://cn.wordpress.org/wordpress-3.9-zh_CN.zip

Seven, decompression

To extract files using unzip:

Unzip Wordpress-3.8-zh_cn.zip

VIII. Create a new database in Mysql

Mysql-u root-p

Enter the database through the command above and enter the password: password

And then create a database called WordPress.

Create DATABASE WordPress;

Ix. Modification of wp-content.php documents

Modify the wp-content.php file in the following form,

/** MySQL database name: WordPress * *
define (' db_name ', ' WordPress '); 
/** MySQL Database user name: root*/
define (' Db_user ', ' root '); 
/** MySQL Database password:p assword*/
define (' Db_password ', ' password ');
/** MySQL host (without modification)/
define (' db_host ', ' localhost ');

Copy the files to the/var/www/html directory.

CP-RF wordpress/*/var/www/html/

XI. Testing

Enter the server's IP in the browser to find your home page.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.