Summary of the entire process of building a PHP environment and WordPress blog program under CentOS, centoswordpress_PHP tutorial

Source: Internet
Author: User
Tags mysql host wordpress blog
Summary of the entire process of building a PHP environment and WordPress blog program under CentOS, centoswordpress. Summary of the entire process of building the PHP environment and WordPress blog program under CentOS, centoswordpress environment server operating system: CentOS7.0 blog Deployment Server: Apache background language: summary of the full process of building a PHP environment and WordPress blog program under CentOS of PHP Data, centoswordpress

Environment

  • Server operating system: CentOS 7.0
  • Blog Deployment Server: Apache
  • Background language: PHP
  • Database: MySql
  • Front-end framework: WordPress

Procedure

1. install Apache

Installing Apache is simple. you only need to enter the following command on the terminal:

sudo yum install httpd

Sudo indicates what operations are performed by the root user. yum install is an online installation. Then, enter yes to confirm the download and installation.
After installation, we need to start the service:

sudo service httpd start

After the server is started, do not worry about it. you can directly enter the ip address of the server in the browser. you should be able to see the welcome page of Apache.
This page is used to test the operation of the Apache HTTP server after it has been installed ......... And so on.
If your ip address has been bound to the domain name, you can enter your domain name in the browser to access it. is it cool? that's just that simple. let's continue.
II. install MySql
Install MySql and start MySql

sudo yum install mysql-serversudo service mysqld start

Through the above command, you can install and start mysql. when installing mysql, you will be asked about some simple configurations. enter and yes.
3. install PHP and related PHP components
Install PHP first

sudo yum install php php-mysql

Install PHP components

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

I have installed these components first. for future use, you can use the following command to search for all PHP components:

yum search php-

4. start Apache and Mysql services by default.
Run the following command to start Apache and Mysql:

sudo chkconfig http onsudo chkconfig mysql on

5. test whether PHP is successfully installed.
Create an info. php file:

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

Enter I to enter the editing mode and write the following PHP command to the file:

<?phpphpinfo();?>

Press the esc key to enter the command mode. press the Shift key and the z key twice to exit and save the file.
Enter the IP address/info. php in the browser, for example, 123.56.183.34/info. php, and press enter to view the PHP information.
6. download WordPress
The Chinese official website is cn.wordpress.org.
Download the following command:

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

VII. decompress
Use unzip to decompress the file:

unzip wordpress-3.8-zh_CN.zip

8. create a database in Mysql

mysql -u root -p

Run the above command to enter the database, and then enter the password: password
Create a database called wordpress

create database wordpress;

9. modify the wp-content.php file
Modify the wp-content.php file as follows,

/** MySQL database NAME: wordpress */define ('Db _ name', 'wordpress ');/** MySQL database username: root */define ('Db _ user', 'root');/** MySQL database password: PASSWORD */define ('Db _ password', 'password '); /** MySQL HOST (no need to modify) */define ('Db _ host', 'localhost ');

10. copy the file to the/var/www/html Directory

cp -rf wordpress/* /var/www/html/

11. test
Enter the server ip address in the browser to view your home page.

Worker environment server operating system: CentOS 7.0 blog Deployment Server: Apache background language: PHP Data...

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.