WP更换域名和IP后出现静态资源无法加载的问题

最近遇到一个问题是关于wp上建立的网站更换域名和IP后WP出现报错的问题,当时忘记截图了,不过我复制了报错的信息,

ERROR1:

Your site doesn’t have the necessary read/write permissions for your file system to use this plugin. Please contact your hosting provider to resolve this matter

ERROR2:

Required File Permissions to import the templates from Starter Templates are missing.

You can easily update permissions by adding the following code into the wp-config.php file.

define( 'FS_METHOD', 'direct' );

因为我的网站是运行在docker上的,从服务器1迁移到服务器2上后某些文件仍处于没有权限的状态,此时进行如下命令修改文件权限即可:

1、首先关闭docker挂载

使用命令:

docker compose -f <你的.yml文件> down

再更改文件权限

chmod -R 755 /path/to/yourpath/public_html
chmod -R 644 /path/to/yourpathm/public_html/*.php
chown -R /path/to/your/pathpublic_html

然后再重新挂载docker

docker compose -f <.yml文件> up -d

再进入你网站的wp后台(ip:port+/wp-admin)就解决问题了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值