我有一个设置有免费主题的WooCommerce网站,并且我尝试重新生成缩略图,因为它们裁剪错误(高产品图片)。>
即使该网站正常运行,我的媒体库也肯定有问题。 从WordPress管理员点击“编辑图片”时,某些图片附件不会显示。其他人可以使用,但我无法为其中任何一个重新生成缩略图:
ERROR: The fullsize image file cannot be found in your uploads directory at myawesomeproduct-full.jpg. Without it, new thumbnail images can't be generated.
这带有HTTP 500错误,通过查看DevTools中的详细错误日志,我看到其中有responseJSON
的{{1}}。这使我指向https://github.com/Viper007Bond/regenerate-thumbnails/blob/master/includes/class-regeneratethumbnails-regenerator.php#L134,因此"code": "regenerate_thumbnails_regenerator_file_not_found"
函数出现问题。
get_fullsizepath()
的服务器中wp-content/uploads
的权限为wp-content/uploads
,文件为755
编辑
显然,644
表中_wp_attached_file
字段中的相对文件路径应该是wp_postmeta
不是 wp-content/uploads/myawesomeproduct-full.jpg
?我在数据库中手动对其进行了修复,但相对于myawesomeproduct-full.jpg
文件夹(而不是WordPress安装文件夹),它已经恢复了原来的状态。