The whole process of building PHP environment and WordPress blog program under CentOS _php instance

Source: Internet
Author: User
Tags mysql host wordpress 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

Installing Apache is simple, just enter the following command at 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 and installation.
After installation we need to start the service:

sudo service httpd start

When the boot server is complete, don't worry about it, 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 had been installed .... Wait a minute
If your IP address has been bound with the domain name, then enter your domain name in the browser can also be accessed, is not very cool, it is so simple, we continue.
Second, install MYSQL
Install MySQL, and start MySQL

sudo yum install Mysql-serversudo service mysqld start

You can install and start MySQL with the above command, you will be asked some simple configuration when you install MySQL, enter enter and yes all the way down OK.
Third, install PHP and related PHP components
Install PHP First

sudo yum install php php-mysql

Install PHP-related components

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

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

Yum Search php-

Iv. boot by default Apache and Mysql services
Use the following command to select Boot Apache and Mysql:

sudo chkconfig http onsudo chkconfig MySQL on

V. Test if 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:

<?phpphpinfo ();? >

Then press the ESC key to enter command mode, press the Shift key and two times the Z key to exit the save file.
Enter the IP address in the browser/info.php, for example: 123.56.183.34/info.php Enter, you can see the PHP information.
Six, download WordPress
Chinese official website is cn.wordpress.org
Download it by using the following command:

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

Seven, decompression
Use Unzip to extract files:

Unzip Wordpress-3.8-zh_cn.zip

VIII. Create a new database in Mysql

Mysql-u root-p

Enter the database via the above command and enter the password: password
And then create a database called WordPress.

Create DATABASE WordPress;

Ix. Modification of wp-content.php files
Modify the wp-content.php file in the form below,

/** 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 see your homepage.

  • 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.