安装wordpress 6.2(php 7.4.2)
一,得到安装包的下载地址:
1,官网地址:
https://cn.wordpress.org/
如图:
点击 获取 WordPress 按钮
2,
在下载WordPress 6.2 按钮上右键,选择:
复制链接地址,
复制的链接如下:
https://cn.wordpress.org/latest-zh_CN.zip
说明:刘宏缔的架构森林是一个专注架构的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/06/06/an-zhuang-wordpress-6-2-php-7-4-2/
对应的源码可以访问这里获取: https://github.com/liuhongdi/
或: https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,下载wordpress:
1,下载
[root@blog ~]# cd /usr/local/source/ [root@blog source]# mkdir wp [root@blog source]# cd wp [root@blog wp]# wget https://cn.wordpress.org/latest-zh_CN.zip
2,解压:
[root@blog wp]# unzip latest-zh_CN.zip
三,配置:
1,创建数据库:
2,执行以下sql创建给wp的用户
mysql> CREATE USER wpuser; ERROR 1396 (HY000): Operation CREATE USER failed for 'wpuser'@'%' mysql> SET PASSWORD FOR wpuser = "password"; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wpuser; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye
3,配置nginx虚拟主机:
把wordpress目录下的代码移动到指定目录下
[root@blog web]# cd /web/wp [root@blog wp]# mv /usr/local/source/wp/wordpress/ /web/wp/
创建上传目录
[root@blog wp]# mkdir wordpress/wp-content/uploads
指定owner和mod
[root@blog wp]# chown -R nginx:nginx /web/wp/wordpress [root@blog wp]# chmod -R 755 /web/wp/wordpress
查看nginx到wp的配置文件
[root@blog conf.d]# more wp.conf server { listen 80; server_name wp.liuhongdi.com; root /web/wp/wordpress; index index.php v.php index.html index.shtml index.htm; access_log /data/logs/nginxlogs/wp.access_log; error_log /data/logs/nginxlogs/wp.error_log; limit_req zone=reqperip burst=20 nodelay; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_buffer_size 32k; fastcgi_buffers 10240 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
四,开始通过web进行安装过程:
访问: wp.liuhongdi.com,
如图:
填写需要的信息:
填写网站标题和用户名、密码,登录网站用的:
提示成功后,点 登录 按钮,跳转到登录页面
登录后如图:
五,查看版本:
1,查看wordpress的版本:
2,查看php的版本:
[root@blog ~]# /usr/local/soft/php7/bin/php --version PHP 7.4.2 (cli) (built: Apr 20 2022 16:49:58) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies