Reputation: 105
Recently I am working on a project, where I need an image resizer script. I searched many times on Google, but I did not found any good script. I just saw one named timthumb, but I'm still getting problems.
I am using this code snippet for trimming the image:
<img src="trim.php?src=/ahsan.jpg&h=150&w=150"/>
But when I run the file, I get an error. I could not found any resized image, but just a blank page. Also, I got this error:
Could not create the file cache directory
How to fix it?
Upvotes: 0
Views: 3463
Reputation: 144
Like A_funs answered, you should have the "cache" folder. If you don't have, create it on your root folder or aside your file.
I managed to solve the problem giving permission to this cache folder through 770 permission.
Upvotes: 0
Reputation: 1246
This is most likely because your file cache directory permissions do not allow TimThumb to write to it. To find your file cache directory go into the timthumb configuration file and look for "FILE_CACHE_DIRECTORY" constant.
Modify the permissions on that folder and make sure it is writable by the user executing the script
Upvotes: 2