I am using TimThumb version : 2.8.14.
After moving site on UAT server its stopped working.
It's show following error.
Could not create the index.html file - to fix this create an empty
file named index.html file in the cache directory. Could not create
cache clean timestamp file.
I have tried some solutions like folder permission and all but still not luck. Issue still coming.
Is this issue from server side ?
Look in your timthumb-config.php, to check if the FILE_CACHE_DIRECTORY is set to the directory you think it is.
You could also delete the existing index.html file that's in the tim thumb cache directory, as tim thumb will automatically create it
You may also need to check the config file to see if the MEMORY_LIMIT is set high enough for your particular images.
Timthumb can't show image after it's uploaded
Related
I want to protect my images on my wordpress site. So I changed the folder permissions of the following folders to 751:
wp-content/uploads
wp-content/uploads/2018
wp-content/uploads/2018/11
However, now when I upload an image via the Media upload, the image is not shown.
Is there any way to keep 403 Error for the above folders while still being able to upload and see the images correctly in the wp-backend?
I know this can be done, because Ive seen this before, I just dont know how to apply it myself.
Any help is greatly appreciated
A better to do this is to simply add the following code to the bottom of your .htaccess file:
Options -Indexes
And you can keep your folder permission to the default 755 and not have to access your cpanel every time you upload a file.
I figured how to do this, but only know how to do it manually.
Part A.
Set permissions to 751 for the following folders:
wp-content/uploads
wp-content/uploads/2018
wp-content/uploads/2018/11
Every month, and year, you need to apply the settings for the new months folder.
Part B.
Upload images in the wordpress backend using media uploader. (Dont worry you cant see the images yet)
Then, in cpanel, go to the folder where those files have uploaded
Next, for all those files you uploaded, change permissions to 644 (it should have been 640 right after you uploaded them)
I need to connect my mamp-Database with the craftcms files, in order to create a new website.
I put all the files for the installation of craft in the requested files. As I wanted to open the link for creating the new page, i got the error message:
The file structure you can see in the images below.
how do I change the file path correctly? Or how do I change the file structure, so the host will find it?
Thanks very much for you answer in advance
I have a site for media conversion where users can upload video, audio or image files and it is converted in to 3 popular formats. Conversion script works fine but I am having some issues with the tmp directory where the files get uploaded to. I have tried 2 scenarios I am fine with either but neither works and it seems to me to be permissions related but I can seem to fix the problem.
I am working locally right now while I work out the kinks.
Scenario 1:
File is uploaded to default local tmp directory (C:\WINDOWS\tmp) - works fine
Attempt to run conversion script using tmp file that was uploaded and it doesn't work - run from command line works perfectly fine though
Scenario 2:
File is uploaded to directory I have given IIS_IUSRS full control of (for testing) and file won't upload - yes the directory is spelt correctly (I changed the upload_tmp_dir value in php.ini)
Both the site the javascript that send the XMLHttpRequest to the PHP file, as well as the site the PHP file itself reside on are IIS sites so I assume the script is being run as IIS_IUSRS.
EDIT: Temp file is no longer being created at all for Scenario 1, can't figure out why I am assuming playing with permission messed something up because the code hasn't changed. I've given Modify to IIS_USRS and USERS to try and get it working again but no luck :( although the error log is still writing to the same folder...weird
NOTE: The "tmp_name" value of the $_FILES variable I am sending still has a value of "C:\WINDOWS\Temp\'filename'" but the file is not there
EDIT: Another new development, it appears it is NOT a permissions issue because I can create a temp file via $temp_file = tempnam(sys_get_temp_dir(), 'Test'); however it obviously does not contain the uploaded data so it does not solve my problem
PHP is ignoring the upload_tmp_dir because of one setting on APPLICATION POOLS.
It's not php-cgi.exe nor php.ini or a permissions issue.
Go to the application pool of the website experiencing the issue:
1. right click
2. select advanced settings
3. scroll to LOAD USER PROFILE and set it to FALSE.
that did the trick for me.
This is less of a problem solved and more of a workaround. The issue seems to be something with the
$_FILES['file']['tmp_name'];
When I echo the contents it looks as I expect however no file appears. So rather than taking advantage of that process that happens naturally, I have had to take a manual approach. What I have done is the following:
create a temp file
$temp_file = tempnam(ini_get('upload_tmp_dir'), 'php');
then add the content from the temp file created during the $_POST request. (which some how are in the $_FILES variable even though the file is not when I look in the directory)
file_put_contents($temp_file, file_get_contents($_FILES['file']['tmp_name']));
the I have my temporary file for processing.
I have been trying to implement File Upload in the site I'm working on but haven't been successful.
If I just copy the files to a test directory on https://static.mysite.com/z_test/index.html
then the example works fine.
If I try to include all the CSS/JS files in a .php file (that uses Xtemplates) and then copy&paste the relevant code from their example it won't work, no selected files will be displayed.
My Site's URL looks like https://mysite.com/test-upload and loads CSS/JS files from https://static.mysite.com/css/... and https://static.mysite.com/js/
could that be the reason why it won't work?
Any suggestions on what (else) I should try to make it work would are greatly appreciated.
This might be a file permissions issue. Check if the path where the files are uploaded on the server has the right permissions.
I figured out the problem, it was related to some overlapping CSS classes, that's why I couldn't see any JS errors.
So I am running xampp and wordpress. I have an image uploaded to the uploads directory named "avatar.jpeg". It displays just fine. But when I delete it and upload a new image file named "avatar.jpeg", the server doesn't reflect the change and just shows the old file. But when I open the file in Eclipse or my explorer, then the server starts showing the change and displays the new image.
This is probably something basic which I never learned about. I tried chmod to set the file permissions on the new file but that didn't help.
The file will be cached in your browser. To force a reload, append an arbitrary variable to your file, e.g. <img src="yourfile.jpg?1234567" />
I also guess it's a caching issue like freddy K. does.
I would suggest to configure ETags on your Server.
Simply appending something to the URL may only help you when the appended string is changing on every update of the requested file(using the current timestamp or similar all the time will force the client to download the file on every request and slow down the page).
http://httpd.apache.org/docs/2.0/mod/core.html#fileetag