Introduction | WordPress is a blog platform developed using PHP language. Users can set up their own website on a server that supports PHP and MySQL databases. You can also use WordPress as a content management system (CMS). WordPress is a personal blogging system that has gradually evolved into a content management system software. It is developed using PHP language and MySQL database. Users can use their blogs on servers that support PHP and MySQL databases. |
Environment description:
Implementing LAMP (Linux + Apache + MariaDB + PHP) on the same host
CentOS 7.3, Apache 2.4.6, MariaDB 5.5.52, PHP 5.4.16
Use yum method to install httpd, MariaDB, php, php-mysql. php-mysql is used to connect php and MariaDB database.
[root@CentOS7 ~]# yum install httpd mariadb-server php php-mysql -y
[root@CentOS7 ~]# vim /etc/httpd/conf.d/vhost.conf DocumentRoot "/var/www/wordpress" ServerName www.mywordpress.com <directory> AllowOverride None Require all granted </directory>
[root@CentOS7 ~]# mkdir /var/www/wordpress
[root@CentOS7 ~]# vim /var/www/wordpress/index.php <!--?php phpinfo(); ?-->
[root@CentOS7 ~]# httpd -t Syntax OK
[root@CentOS7 ~]# systemctl start httpd.service
Enter www.mywordpress.com
in the browserYou can see that the PHP default page has been successfully displayed, indicating that the test is successful
6 Download the wordpress compressed package, wordpress-4.7.4-zh_CN.tar.gz (1) Decompression[root@CentOS7 ~]# tar -xf wordpress-4.7.4-zh_CN.tar.gz
[root@CentOS7 ~]# cp -a wordpress /var/www/wordpress/
[root@CentOS7 ~]# systemctl start mariadb
Enter http://www.mywordpress.com/wordpress
in the browserNote: Configure the DNS server to resolve www.test.com to 192.168.29.100
Or modify the C:\Windows\Systeme32\drivers\etc\hosts file under windows
192.168.29.100 www.test.com
You can see that the wordpress page has been created. You can click "Start Now" to configure it, or you can manually modify the configuration file
9 Modify wordpress configuration file (1) Enter the WordPress directory (/var/www/wordpress/wordpress/)[root@CentOS7 ~]# cd /var/www/wordpress/wordpress/
[root@CentOS7 ~]# vim /var/www/wordpress/wordpress/wp-config.php // ** MySQL 设置 - 具体信息来自您正在使用的主机 ** // /** WordPress数据库的名称 */ define('DB_NAME', 'wordpress'); /** MySQL数据库用户名 */ define('DB_USER', 'test1'); /** MySQL数据库密码 */ define('DB_PASSWORD', '123456'); /** MySQL主机 */ define('DB_HOST', 'localhost');
MariaDB [(none)]> create database wordpress; Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user 'test1'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all on wordpress.* to 'test1'@'localhost'; Query OK, 0 rows affected (0.01 sec)
http://www.mywordpress.com/wordpress
Fill in the relevant information and you can access the blog normally.
The above is the detailed content of The Free Way to Start a WordPress Blog – Build It With LAMP. For more information, please follow other related articles on the PHP Chinese website!