Wordpress 上传错误 - 未写入数据库

Wordpress uploads error - is not writing to database

我最近将我的 WordPress 博客从一台服务器移到了另一台服务器,更改了 URL 路径。我决定为图片和上传使用子域。

上传图片后出现此错误:

"An error occurred in the upload. Please try again later."

我更改了数据库中的 URL 路径,因此所有现有上传都按预期显示。新上传的内容将在 /static/uploads 中以年月为间隔上传。

图像未添加到数据库。几次尝试上传后,我通过 FTP 进入上传目录并确认上传存在,但由于某种原因它们没有写入数据库。

我想更正此问题,以便将上传内容同时写入服务器和数据库。

我没有示例代码或其他,也没有机会查看错误日志。

任何修复或帮助将不胜感激。谢谢!

如果您仍然有旧数据库的副本,请尝试通过修复序列化数据和路径将旧域或 URL 替换为新域。

A serialized string not only stores the value of a object but also its size (number of characters) therefore if the old and the new domains or URLs have different character counts, PHP will not be able to recreate the original object anymore.

WordPress Serialized PHP Search and Replace