This article mainly shares with you how to build a personal blog using WordPress. It mainly shares it with you in the form of pictures, text and code. I hope it can help you.
1 LNMP combination
1.1 Verify the connectivity from Nginx to php
All environments have been configured in the previous blog posts, let’s test Nginx and Connectivity between php
LNMP Nginx service construction and three types of virtual hosts
LNMP binary installation mysql-5.5.54
LNMP source code compilation and installation php- 5.5.32
# 修改/application/nginx/conf/extra/blog.conf[root@web01 extra]# cat blog.conf server { listen 80; server_name blog.rsq.com; location / { root html/blog; index index.html index.htm; } location ~ .*\.(php|php5)?$ { root html/blog; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } }# 重启nginx服务[root@web01 extra]# ../../sbin/nginx -tnginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful [root@web01 extra]# ../../sbin/nginx -s reload# 在/application/nginx/html/blog/目录中写一个Build a personal blog with WordPress文件,测试连通性[root@web01 extra]# cd /application/nginx/html/blog/[root@web01 blog]# echo "<?php Build a personal blog with WordPress(); ?>" >test_info.php[root@web01 blog]# cat test_info.php<?php Build a personal blog with WordPress(); ?>
# Do the access test in windows browser. If the following page appears, the test is successful
1.2 Verify php Connectivity to mysql
# 写一个简单的数据库连接脚本[root@web01 blog]# cat test_mysql.php<?php $link_id=mysql_connect('localhost','root','oldboy123') or mysql_error(); if($link_id){ echo "Mysql successful by RSQ !"; }else{ echo mysql_error(); }?>
# Browser side test
2 LNMP wordpress personal blog construction
2.1 Create wordpress database
# 先登录mysql,创建WordPress所需要的数据库 [root@web01 ~]# mysql -uroot -poldboy123mysql> show databases; +--------------------+| Database | +--------------------+| information_schema | | mysql | | performance_schema || test | +--------------------+4 rows in set (0.01 sec) mysql> drop database test; # 删除多余的test数据库 Query OK, 0 rows affected (0.02 sec)mysql> show databases; #显示数据库 +--------------------+| Database | +--------------------+| information_schema | | mysql | | performance_schema |+--------------------+3 rows in set (0.00 sec) mysql> create database wordpress; # 创建wordpress用户 Query OK, 1 row affected (0.00 sec)mysql> show databases; +--------------------+| Database | +--------------------+| information_schema | | mysql | | performance_schema || wordpress | +--------------------+4 rows in set (0.00 sec)mysql> select user(); +----------------+| user() | +----------------+| root@localhost | +----------------+1 row in set (0.00 sec)mysql> select user,host from mysql.user; #查看当前数据库用户 +------+-----------+| user | host | +------+-----------+| root | 127.0.0.1 | | root | ::1 | | | localhost || root | localhost | +------+-----------+4 rows in set (0.00 sec) # 为wordpress数据库创建专门管理的wordpress用户并授予所有权限 mysql> grant all on wordpress.* to wordpress@'localhost' identified by '123456'; Query OK, 0 rows affected (0.00 sec)mysql> select user,host from mysql.user; # 查看wordpress数据库用户是否创建 +-----------+-----------+| user | host | +-----------+-----------+| root | 127.0.0.1 | | root | ::1 | | | localhost | | root | localhost || wordpress | localhost | +-----------+-----------+5 rows in set (0.00 sec) mysql> show grants for wordpress@'localhost'; # 查看指定用户所具有的权限 mysql> flush privileges; # 刷新一下,使用户权限生效 Query OK, 0 rows affected (0.00 sec)
2.2 Modify the blog.conf configuration file
# blog.conf配置文件中index新增index.html[root@web01 extra]# cat blog.conf server { listen 80; server_name blog.rsq.com; location / { root html/blog; index index.php index.html index.htm; } location ~ .*\.(php|php5)?$ { root html/blog; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } } [root@web01 tools]# /application/nginx/sbin/nginx -t nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is oknginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful [root@web01 tools]# /application/nginx/sbin/nginx -s reload
2.3 Download the wordpress software package
# First go to the official website to check the version of the supported plug-in
# 去官网下载最新的wordpress软件包[root@web01 extra]# cd /home/oldboy/tools/[root@web01 tools]# wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz# 解压缩[root@web01 tools]# tar -xf wordpress-4.9.4-zh_CN.tar.gz# 拷贝wordpress目录下的所有内容到/application/nginx/html/blog/目录下[root@web01 tools]# cp -a wordpress/* /application/nginx/html/blog/[root@web01 tools]# ls /application/nginx/html/blog/index.php wp-blog-header.php wp-includes wp-settings.phplicense.txt wp-comments-post.php wp-links-opml.php wp-signup.phpreadme.html wp-config-sample.php wp-load.php wp-trackback.phpwp-activate.php wp-content wp-login.php xmlrpc.phpwp-admin wp-cron.php wp-mail.php# 授予权限,先暂时授予所有文件,以后再调整权限[root@web01 tools]# chown -R www.www /application/nginx/html/blog/
2.4 Install wordpress on the web page
# The client hosts file needs to be parsed
Table of Contents
- 1 LNMP combination
- 1.1 Verify Nginx to PHP connectivity Property
- 1.2 Verify the connectivity from php to mysql
- 2 LNMP WordPress personal blog construction
- 2.1 Create wordpress database
- 2.2 Modify blog.conf configuration file
- 2.3 Download wordpress software package
- 2.4 Web page installation wordpress
All the environments have been configured in the previous blog posts. Let’s test the connection between Nginx and php
LNMP Nginx service establishment and three types of virtualization HostLNMP binary installation mysql-5.5.54
LNMP source code compilation and installation php-5.5.32# 修改/application/nginx/conf/extra/blog.conf[root@web01 extra]# cat blog.conf server { listen 80; server_name blog.rsq.com; location / { root html/blog; index index.html index.htm; } location ~ .*\.(php|php5)?$ { root html/blog; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } }# 重启nginx服务[root@web01 extra]# ../../sbin/nginx -tnginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful [root@web01 extra]# ../../sbin/nginx -s reload# 在/application/nginx/html/blog/目录中写一个Build a personal blog with WordPress文件,测试连通性[root@web01 extra]# cd /application/nginx/html/blog/[root@web01 blog]# echo "<?php Build a personal blog with WordPress(); ?>" >test_info.php[root@web01 blog]# cat test_info.php<?php Build a personal blog with WordPress(); ?>
# Do access test in windows browser, if it appears The following page tested successfully
# 写一个简单的数据库连接脚本[root@web01 blog]# cat test_mysql.php<?php
$link_id=mysql_connect('localhost','root','oldboy123') or mysql_error(); if($link_id){ echo "Mysql successful by RSQ !";
}else{ echo mysql_error();
}?>
# Browser-side test
# 先登录mysql,创建WordPress所需要的数据库
[root@web01 ~]# mysql -uroot -poldboy123mysql> show databases;
+--------------------+| Database |
+--------------------+| information_schema |
| mysql |
| performance_schema || test |
+--------------------+4 rows in set (0.01 sec)
mysql> drop database test; # 删除多余的test数据库
Query OK, 0 rows affected (0.02 sec)mysql> show databases; #显示数据库
+--------------------+| Database |
+--------------------+| information_schema |
| mysql |
| performance_schema |+--------------------+3 rows in set (0.00 sec)
mysql> create database wordpress; # 创建wordpress用户
Query OK, 1 row affected (0.00 sec)mysql> show databases;
+--------------------+| Database |
+--------------------+| information_schema |
| mysql |
| performance_schema || wordpress |
+--------------------+4 rows in set (0.00 sec)mysql> select user();
+----------------+| user() |
+----------------+| root@localhost |
+----------------+1 row in set (0.00 sec)mysql> select user,host from mysql.user; #查看当前数据库用户
+------+-----------+| user | host |
+------+-----------+| root | 127.0.0.1 |
| root | ::1 |
| | localhost || root | localhost |
+------+-----------+4 rows in set (0.00 sec)
# 为wordpress数据库创建专门管理的wordpress用户并授予所有权限
mysql> grant all on wordpress.* to wordpress@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)mysql> select user,host from mysql.user; # 查看wordpress数据库用户是否创建
+-----------+-----------+| user | host |
+-----------+-----------+| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost || wordpress | localhost |
+-----------+-----------+5 rows in set (0.00 sec)
mysql> show grants for wordpress@'localhost'; # 查看指定用户所具有的权限
mysql> flush privileges; # 刷新一下,使用户权限生效
Query OK, 0 rows affected (0.00 sec)
2.2 Modify blog.conf configuration file# blog.conf配置文件中index新增index.html[root@web01 extra]# cat blog.conf
server {
listen 80;
server_name blog.rsq.com;
location / {
root html/blog;
index index.php index.html index.htm;
}
location ~ .*\.(php|php5)?$ {
root html/blog;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
[root@web01 tools]# /application/nginx/sbin/nginx -t nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is oknginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@web01 tools]# /application/nginx/sbin/nginx -s reload
2.3 Download wordpress software Package
# First go to the official website to check the version of the supported plug-ins
# 去官网下载最新的wordpress软件包[root@web01 extra]# cd /home/oldboy/tools/[root@web01 tools]# wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz# 解压缩[root@web01 tools]# tar -xf wordpress-4.9.4-zh_CN.tar.gz# 拷贝wordpress目录下的所有内容到/application/nginx/html/blog/目录下[root@web01 tools]# cp -a wordpress/* /application/nginx/html/blog/[root@web01 tools]# ls /application/nginx/html/blog/index.php wp-blog-header.php wp-includes wp-settings.phplicense.txt wp-comments-post.php wp-links-opml.php wp-signup.phpreadme.html wp-config-sample.php wp-load.php wp-trackback.phpwp-activate.php wp-content wp-login.php xmlrpc.phpwp-admin wp-cron.php wp-mail.php# 授予权限,先暂时授予所有文件,以后再调整权限[root@web01 tools]# chown -R www.www /application/nginx/html/blog/2.4 Install wordpress on the webpage
# The client hosts file needs to be parsed
related suggestion :
LAMP Detailed graphic and text explanation of building a personal blog based on the php module
Steps to build a personal blog using WordPress using HTTPS
php personal blog Talk about those things inherited by PHP, my personal opinion
The above is the detailed content of Build a personal blog with WordPress. For more information, please follow other related articles on the PHP Chinese website!

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool