centos安装wordpress

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/weixin_42818402/article/details/100572917

1.安装&配置mysql

https://mp.csdn.net/postedit/100572899

2.安装&配置nginx

centos安装nginx

//nginx配置
server {
    listen       80;                        # 监听端口
    server_name www.siteA.com siteA.com;    # 站点域名
    root  /data/webs/wordpress;              # 站点根目录
    index index.html index.htm index.php;   # 默认导航页

    location / {
        # WordPress固定链接URL重写
        if (!-e $request_filename) {
            rewrite (.*) /index.php;
        }
    }
    # PHP配置
    location ~ \.php$ {
        root  /data/webs/wordpress;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;        
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

3.安装&配置php

https://mp.csdn.net/postedit/100572876

php.ini在/etc/php.ini
第1步:php.ini中 添加extension=mysql.so
第2步:在PHP.ini 中修改extension_dir = “/usr/lib64/php/modules”

4.安装&配置wordpress

4.1中文版下载地址

https://cn.wordpress.org/download/releases/

4.2配置

打开配置文件wp-config-sample.php,修改这三项
define(‘DB_NAME’, ‘dbname’);
define(‘DB_USER’, ‘root’);
define(‘DB_PASSWORD’, ‘你的mysql密码’);
添加
define(‘FS_METHOD’,'direct’);
define(‘FS_CHMOD_DIR’, 0777);
define(‘FS_CHMOD_FILE’, 0777);

4.3修改权限

修改网站根目录权限,如果根目录是wordpress
chmod 777 wordpress

4.4启动nginx,php-fpm,mysql,然后打开主页,按提示操作

猜你喜欢

转载自blog.csdn.net/weixin_42818402/article/details/100572917
今日推荐