Could Not Create The File Cache Directory Timthumb Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn could not create cache clean timestamp file. more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags timthumb cache directory. Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, a timthumb error has occurred no image specified helping each other. Join them; it only takes a minute: Sign up Timthumb getting error: Could not create the file cache directory up vote 0 down vote favorite Recently I am working on a project, where I need
Timthumb Cache Folder Permissions
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: 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 could not open the lockfile for writing an image. fix it? php timthumb share|improve this question edited Mar 15 '14 at 23:03 MC Emperor 4,02573675 asked Mar 15 '14 at 22:51 user2951112 3019 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote 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 share|improve this answer answered Sep 30 '14 at 12:48 A_funs 6211824 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged php timthumb or ask your own question. asked 2 years ago viewed 1047 times active 2 years ago Related 0How to delete specific files from timthumb's cache?0TimThumb error: Could not get a lock for writing1500 Error on Timthumb0Make timthumb return error?1Wordpress W3 Total Cache CDN image issue (timthumb)1Using Timthumb file in xslt2PHP timthumb error with Joomla0Timthumb 403 forbidden issue1What
fly. Occasionally though, it can throw up some errors that can be fiddly to debug. This post looks at the key things timthumb not working on server to check when something goes wrong... Finding the error If you try
A Timthumb Error Has Occurred Joomla
going directly to the url that is in the image tag that isn't loading (within the 'src'
Could Not Find The Internal Image You Specified.
attribute, or in some browsers right click and 'view image'), Timthumb should give you the specific error that is occurring (e.g. "Could not create cache clean timestamp file"), http://stackoverflow.com/questions/22430784/timthumb-getting-error-could-not-create-the-file-cache-directory this will give you a bit more information to work with. How to fix the 'Could not create cache clean timestamp file' error The following steps should resolve most Timthumb caching problems: - Check inside your timthumb configuration file that the FILE_CACHE_DIRECTORY is pointing to a valid cache directory - Try deleting the 'index.html' and / http://www.codesynthesis.co.uk/troubleshooting/timthumb-could-not-create-cache-clean-timestamp-file or the 'tumthumb_cacheLastCleanTime.touch' file inside your cache directory, Timthumb will automatically re-generate these - Check that the cache folder has the right permissions (this should be set to 755 or 777) - Check that the cache folder is owned by the web server user so it can create the cached files. You can check ownership for this on the command line using: ls -lh Resources For more general timthumb troubleshooting see Binary Moon for helpful tips. GET THE LATEST TUTORIALS: All Articles WordPress CSS HTML JQuery PHP Sign Up Please enable JavaScript to view the comments powered by Disqus. comments powered by Disqus GET THE LATEST TUTORIALS All Articles WordPress CSS HTML JQuery PHP Sign Up Categories Code Snippets Tutorials Technology Troubleshooting Tools Business Popular Tags Technology HTML Video HTML5 CSS Need a web developer? If you'd like to work with code synthesis on your next project get in touch via the contact page. Tweets by @codesynthesis Social Projects Coveloping Speed up your development with coveloping's ran
Secrets I often get asked questions about TimThumb and why it doesn't work in certain situations. I can generally tell what is wrong with the script within about 60 seconds of being sent a demo url. Below are my top tips for debugging TimThumb issues. Keep TimThumb https://www.binarymoon.co.uk/2010/11/timthumb-hints-tips/ up to Date This is super important. TimThumb should always be kept up to date. I regularly publish bug fixes and improvements and often the problems listed below will actually be fixed already if you only used the latest version. Just grab the latest version of TimThumb from Google Code and upload it. Is your problem fixed now? If so then great! 🙂 If not then read on and we'll sort it out! If you've not heard of TimThumb before then it's a could not simple PHP file used to resize images dynamically. You can read more about it, and find some ‘getting started' style hints and tips on the TimThumb Project Page. TimThumb Secrets Right Click > View Image - If an image isn't loading then this is the first thing you should do. 9 times out of 10 it will tell you what the problem is in an easy to read error message. Supply an Image url - this is surprisingly common. TimThumb is clever, could not create but unfortunately it needs to be fed image paths so that it knows what to resize. This is pretty fundamental, you can read more info on getting started with TimThumb here. urlencode(url-with-parameters); - if the image you are resizing is a dynamic one (ie, it has &skdh=khdkfs&ksjdsjd=ksh) then it is unlikely to resize properly. Simply change your image url so that it is wrapped in a call to the urlencode PHP function. This is something I would always recommend doing as it will encourage TimThumb to work in more situations. Cache Directories do not exist - For TimThumb to work properly you need to have a cache directory called cache sitting alongside the timthumb.php file. Cache Directory Permissions - the cache directory should exist inside the same directory as TimThumb. It should have permissions set to 777. More Cache Directory Permissions - if 777 doesn't work then you may find 755 is ok. It's worth a try, but not something I have seen very often. Cross Domain Request - for security TimThumb restricts cross domain requests. Certain websites, such as Flickr, are allowed by default, but if you want to load an image from another website then you need to make sure it's added to TimThumb. You can read about cross domain TimThumb requests on a previous post. File Permissions - some web hosts won't execute PHP code if it sits in directories that have permissions set to 777. So make sure that any directories ‘a