以下是通过审查元素访问图片地址弹出的错误提示:
A TimThumb error has occured
The following error(s) occured:
- You may not fetch images from that site. To enable this site in timthumb, you can either add it to $ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.
Query String : src=http://miyunrj.oss-cn-hangzhou.aliyuncs.com/1713833788920.jpg&h=200&w=300&zc=1&a=t&q=100&s=1
看下翻译后的内容:
这提示的意思就是说我们网站程序不让访问这个外链缩略图的域名,如果想要访问需要在主题: timthumb.php 文件中添加外链缩略图的域名才可以正常访问,或者是在“ALLOW_ALL_EXTERNAL_SITES=false”改成“ALLOW_ALL_EXTERNAL_SITES=true”,我试了第二种方法,没有效果,然后换成第一种方法,把外链域名添加到主题“timthumb.php”这个文件中,清理一下浏览器缓存就正常显示了。
添加以下域名后正常了:
‘i1.wp.com’,(wordpress官方域名)
‘i2.wp.com’,
‘i3.wp.com’,
‘i4.wp.com’,
‘i5.wp.com’,
‘i6.wp.com’,
‘i7.wp.com’,
‘i8.wp.com’,
‘i9.wp.com’,
‘miyunrj.oss-cn-hangzhou.aliyuncs.com’,(我的阿里云储存域名)