简体   繁体   English

Timthumb没有在特定域中显示外部站点图像

[英]Timthumb didn't display external site images in specific domain

I am using timthumbs in my wordpress site. 我在wordpress网站上使用timthumbs。 But I included all the changes which I found when I search for this problem. 但我列出了搜索此问题时发现的所有更改。

I have enabled the "ALLOW_EXTERNAL" and "ALLOW_ALL_EXTERNAL_SITES" . 我启用了“ALLOW_EXTERNAL”和“ALLOW_ALL_EXTERNAL_SITES”。

   //Image fetching and caching
if(! defined('ALLOW_EXTERNAL') )            
define ('ALLOW_EXTERNAL', TRUE);                        
// Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false

if(! defined('ALLOW_ALL_EXTERNAL_SITES') )
 define ('ALLOW_ALL_EXTERNAL_SITES', true);

I have recreated my .htaccess file . 我重新创建了我的.htaccess文件。 I Have also included the following code in my .htaccess file. 我还在我的.htaccess文件中包含了以下代码。

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

But it is not working in my domain. 但它不适用于我的域名。 But it is working in other domain. 但它在其他领域工作。

Image URL which I tried to access is 我试图访问的图片网址是

URL : http://webhugh.org/viyugam/timthumb/timthumb.php?src=http://farm3.static.flickr.com/2340/2089504883_863fb11b0a_z.jpg 网址: http//webhugh.org/viyugam/timthumb/timthumb.php? src = http://farm3.static.flickr.com/2340/2089504883_863fb11b0a_z.jpg

I am getting 403 forbidden , I gave 0755 permission to cache folder as well. 我得到了403禁止 ,我也给了0755缓存文件夹的权限。

You are getting a 500 Internal Server Error whenever you try to access timthumb directly, or if you pass a local image to it(for instance http://webhugh.org/viyugam/timthumb/timthumb.php?src=/images/webhugh-slider-background.png&w=100&h=100 ). 每当您尝试直接访问timthumb,或者您将本地图像传递给它时,您将收到500 Internal Server Error (例如http://webhugh.org/viyugam/timthumb/timthumb.php?src=/images/webhugh-slider-background.png&w=100&h=100 )。

Please try using a clean and working TimThumb and see if you still have that issue. 请尝试使用干净且有效的TimThumb,看看你是否还有这个问题。

If you can render the local image example, then just add the external domain to your allowed domains. 如果您可以呈现本地图像示例,则只需将外部域添加到允许的域中。

If you can't then it's most-likely server misconfiguration - try adding the following lines at the beginning of timthumb.php: 如果你不能那么它最可能的服务器配置错误 - 尝试在timthumb.php的开头添加以下行:

error_reporting(E_ALL);
ini_set('display_errors', '1');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM