4

I am using timthumbs in my wordpress site. 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" .

   //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 . I Have also included the following code in my .htaccess file.

<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

I am getting 403 forbidden, I gave 0755 permission to cache folder as well.

Ananth
  • 1,520
  • 3
  • 15
  • 28

1 Answers1

1

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).

Please try using a clean and working TimThumb and see if you still have that issue.

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:

error_reporting(E_ALL);
ini_set('display_errors', '1');
Nikola Ivanov Nikolov
  • 5,022
  • 1
  • 26
  • 27
  • Hi Nikola, I have added that lines. But i got the same 403 forbidden error. – Ananth Nov 23 '12 at 12:43
  • Internal images are working fine. Internal Image url :http://webhugh.org/viyugam/timthumb/timthumb.php?src=http://webhugh.org/viyugam/wp-content/themes/viyugam/images/thumbl_980x340.png. But External site images are not displaying . External Image url : http://webhugh.org/viyugam/timthumb/timthumb.php?src=http://farm3.static.flickr.com/2340/2089504883_863fb11b0a_z.jpg&w=150&h=120 – Ananth Nov 23 '12 at 12:49
  • Hmm.. that's pretty odd. Did you try adding the error reporting lines? It seems that the Forbidden header should not be coming from TimThumb itself(I couldn't find a code that would send that header in TimThumb's code). – Nikola Ivanov Nikolov Nov 23 '12 at 13:16
  • Do you have a `temp` folder? It needs to be set to 755 as well and is required when you fetch images from external sites. – Nikola Ivanov Nikolov Nov 23 '12 at 13:19
  • i can't find temp folder. I have only cache folder with permissin 777. I tried error reporting lines but i don't get any errors. THis is the path which i uploaded the timthumb. URL : http://webhugh.org/viyugam/timthumb/ – Ananth Nov 23 '12 at 13:52
  • Create a `temp` folder in the same directory where `timthumb.php` resides. Set it's permissions to 755. Try again - if it's still not working set the permissions to 777. Report if it's still not working :) – Nikola Ivanov Nikolov Nov 23 '12 at 14:21
  • I have created the temp folder with 755 permission and also with 777. But still I am getting 403 Forbidden. – Ananth Nov 24 '12 at 05:54
  • Can you post your `timthumb.php` script on [piratepad.net](http://piratepad.net/)? I want to take a look at it and test it on my system. If it works properly on my system, then it's a problem in your system and you should contact your hosting company and ask them about that. – Nikola Ivanov Nikolov Nov 24 '12 at 09:20
  • So, it's working fine on my localhost - I suggest that you contact your hosting provider and have them look into that. Tell them that you are using TimtThumb and that when you try to fetch external images, you get 403 code. Give them the link and hopefully they should be able to tell you what the problem is and probably how to fix it. – Nikola Ivanov Nikolov Nov 24 '12 at 12:05