wordpress Timthumb 上传后无法显示图片
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14396991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Timthumb can't show image after it's uploaded
提问by jOpacic
I'm using Wordpress plugin called User Avatar, that uses Timthumb for image display. When I open page to show the image, it gives error 500 in the console, and when I use that image link in new tab, I get following error:
我正在使用名为 User Avatar 的 Wordpress 插件,该插件使用 Timthumb 进行图像显示。当我打开页面以显示图像时,它在控制台中给出错误 500,当我在新选项卡中使用该图像链接时,出现以下错误:
A TimThumb error has occured
The following error(s) occured:
Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.
Could not create cache clean timestamp file.
Query String : src=http://my.domain.com/wp-content/uploads/avatars/1/1358504649-bpfull.jpg&w=150&id=1&random=1358504649
TimThumb version : 2.8.10
I persume it's a server error or misconfiguration, everything is being uploaded into folder uploads
, then into avatars
subfolder, which has 0777
permission, folder 1
also has 0777
.
我认为这是服务器错误或配置错误,所有内容都上传到文件夹uploads
,然后上传到avatars
具有0777
权限的子文件夹,文件夹1
也有0777
.
Insinde, there are both cache
and temp
folders, both with 0777
permissions.
GD Image Lib is enabled on the server.
Insinde,有cache
和temp
文件夹,都有0777
权限。GD Image Lib 在服务器上启用。
回答by TameRobots
Look in your timthumb-config.php, to check if the FILE_CACHE_DIRECTORY
is set to the directory you think it is.
查看您的 timthumb-config.php,检查是否FILE_CACHE_DIRECTORY
设置为您认为的目录。
You could also delete the existing index.html file that's in the tim thumb cache directory, as tim thumb will automatically create it (back it up somewhere first just in case)
您还可以删除 tim thumb 缓存目录中的现有 index.html 文件,因为 tim thumb 会自动创建它(以防万一,先将其备份到某处)
You may also need to check the config file to see if the MEMORY_LIMIT
is set high enough for your particular images.
您可能还需要检查配置文件以查看是否MEMORY_LIMIT
为您的特定图像设置了足够高的值。
You should also check that the cache folder is owned by the webserver and not by you.
您还应该检查缓存文件夹是否归网络服务器所有,而不是归您所有。
Other troubleshooting help here: http://www.binarymoon.co.uk/2010/11/timthumb-hints-tips/
其他故障排除帮助:http: //www.binarymoon.co.uk/2010/11/timthumb-hints-tips/