Wordpress Error: A TimThumb error has occured - php

I've encountered an error after installing wordpress onto a new domain.
I've contacted the theme developer and have had no luck resolving the issue.
I receive the following error when i copy the image link:
Warning: touch() [function.touch]: Utime failed: Permission denied in /home/domain/public_html/wp-content/themes/folioway/core/thumb.php on line 190
Warning: Cannot modify header information - headers already sent by (output started at /home/domain/public_html/wp-content/themes/folioway/core/thumb.php:190) in /home/domain/public_html/wp-content/themes/folioway/core/thumb.php on line 413
A TimThumb error has occured
The following error(s) occured:
Could note create the index.html file.
Query String : src=/wp-content/uploads/2012/03/CoffeetabeBox-custom_web1.jpg&w=187&h=187&zc=1&q=90
TimThumb version : 2.8.2
I have not modified anything else aside from some CSS.
The thumbnails do not appear on the pages, however, the images do appear in lightbox.
I have set the permissions to the cache folder to 777, but this has not resolved the issue.
Any help would be greatly appreciates. Thanks.

It happened to me too, and this is the second time!
If you don't have time to discover why, but you want to keep it working, just rename, or delete your /cache folder; then, create a brand new /cache folder, set permissions to 777, and it will work again.

I found that the cache folder this is referring to is the one within the same folder as timthumb.php - find that file and the related cache folder and give the cache folder 777 permissions.

if you are on a linux based server,
first find the FILE_CACHE_DIRECTORY from the config file by (ex. in linux server open the file in vi commond)
vi /system/web/esupu/wp-content/themes/gadgetry-parent/framework/timthumb/timthumb-config.php
it could be like
define('FILE_CACHE_DIRECTORY', '../../cache/');
SO we change the cache folder ownership to user "www-data" which is the default user for Apache web server which runs this php codes,
sudo chown -hR www-data:www-data /system/web/esupu/wp-content/themes/gadgetry-parent/cache/
also, now better check if folder can be writable too (chmod permissions to 777)

Instead of using 777 as others have suggested, use 755 to the /cache folder.

I just delete the cache folder and refresh the page where code was, it started working.
I think it is the problem of file permission.

Headers already sent is usually a symptom of whitespace either at the beginning or the end of the file - check timthumb.php and make sure you have no blank lines or space either before the
The other possibility is that /wp-content/uploads/ is not writable by the web server, but I'd bank on the first one being the cause.

I added this to a php.ini file:
display_errors = Off
display_warnings = Off
output_buffering = On

TimThumb is a separate open source project that is used by many WP plugins.
If updating folder permissions doesn't work for you, another solution which worked for me was to update the plugin's TimThumb script with the most recent version. You can download it here:
https://timthumb.googlecode.com/svn/trunk/timthumb.php
In my case this file was in wp-content/plugins/events-manager/includes/thumbnails

For others that have this issue when using the FiatLux Wordpress Theme, as I am here is the solution:
Open FTP like Filezilla
Navigate to yoursite/wp-content/themes/fiatlux/includes*
Delete the cache folder
Recreate the cache folder, with permission setting 755
Download the updated timthumb.php file from GitHub and replace (I renamed the old one timthumb.old to test
If you use a Media server/ CDN, then be sure to add that site to the $ALLOWEDSITES array in TimThumb.php file
*If using another Wordpress theme, then find the TimThumb.php file and corresponding cache folder in that theme/ plugins folder in wp-content

in
src=/wp-content/uploads/2012/03/CoffeetabeBox-custom_web1.jpg&w=187&h=187&zc=1&q=90
try put a '?' between .jpg and &w, so it will be like this
src=/wp-content/uploads/2012/03/CoffeetabeBox-custom_web1.jpg?&w=187&h=187&zc=1&q=90

Related

Joomla 3.4.4. tmp directory

I have problem with installing any extensions in Joomla! 3.4.4.
When I try to install any i have error
An error has occurred.
-1 Copy file failed
I set all CHMOD for 777 (for tests) in configuration.php there is correct path to tmp directory. One thing that is strange is info in joomla backend:
The PHP temporary folder is not set. The PHP temporary folder is the
folder that PHP uses to store an uploaded file before Joomla can
access this file. Whilst the folder not being set isn't always a
problem, if you are having issues with manifest files not being
detected or uploaded files not being detected, setting this in your
php.ini file might fix the issue.
I don't have access to php.ini so i can't use upload_tmp_dir . When i try make my own php.ini file and then make rule in .htaccess nothing happens. Maybe someone had the same problem?
Set the directory to 755 firstly. No need for 777.
Make sure the directory is linked via the home i.e.
/home/your_user_account/public_html/tmp
And also then check your hosting package has not run out of diskspace.
These are the common problems.

Error Uploading images in drupal

I was trying to upload a custom logo to my drupal site which runs on IIS 8 with PHP.
I got the following upload error :
" Warning: move_uploaded_file(temporary://logo.png): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in drupal_move_uploaded_file() (line 1642 of C:\inetpub\wwwroot\drupalfull\includes\file.inc).
Warning: move_uploaded_file(): Unable to move 'C:\Windows\Temp\php25C3.tmp' to 'temporary://logo.png' in drupal_move_uploaded_file() (line 1642 of C:\inetpub\wwwroot\drupalfull\includes\file.inc).
File upload error. Could not move uploaded file."
Please help me. I have set both read and write permissions on IIS but still it does not work.
Create sites/default/files/tmp folder and give full permissions (777) and change 'Temporary directory' at admin/config/media/file-system.
I think it fixes yout problem.
Regards.
If you are running ISS8 (web server) then the file path is different then the default for Unix.
Make sure you have the temporary folder setup correctly on your settings in Drupal and the folder has write permissions.
You can follow this article at step 5 and 6.
Create the folder:
Drupal uses the Sites\Default\Files directory to store temporary files and therefore must be able to write and modify files in this folder.
Create the folder:
C:\inetpub\wwwroot\Drupal>md sites\default\files
http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/install-drupal-on-iis
Your problem is most likely the permission problem inside drupal. Since you are using windows system, you need to make sure the folder sites/default/files have writable permission for the IIS server. Config the permission to be writable for all user and see if it is working and then limit the permission step by step until you feel comfortable.
I'm going to put another answer in here because I guarantee I'm going to forget how I fixed it!
Basically, on Windows, the default upload folder for PHP is C:\Windows\Temp. As part of the Drupal upload, it moves files from the PHP upload folder to the Drupal Temporary//: folder. There is an issue however in PHP whereby the PHP executable needs read permission to the full path to the uploaded files, so C:\Windows\Temp. If this is not given, it will error out and the file will not be moved.
Details are at http://php.net/manual/en/function.realpath.php which is a function call made deep in Drupal's upload file code.
My fix was to create a folder elsewhere, say C:\PHPTemp, and modify PHP's settings (session.save_path and upload_tmp_dir) to point to this folder instead. After giving IIS_IUSRS full control (overkill? probably!), I was then able to upload images!

Timthumb getting error: Could not create the file cache directory

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

VQmod on new VPS not writing vqcache files or log files

I am just moving an opencart site to a staging server and have vqmod installed in the site however I can't get vqmod to create the vqcache files and it isn't even logging any errors in the vqmod/log folder. I've basically set the directory structure to 777 to get it to work from a permissions point of view and everything is ownership user:www-data but still no joy.
Just in case anyone has a similar issue, it was a user groups issue, the ownership settings for the vqmod.php file were user:user rather than the required user:www-data
You should actually set the permissions for your vqmod.php to be the same as your index.phpin your main OpenCart folder, not alter the owner of the file. You should also set the permissions of the following be the same as your /system/cache/ folder
/vqmod/
/vqmod/vqcache/
/vqmod/logs/

Joomla tmp folder not writable? or open_basedir troubles?

i'm working on this joomla site and im not able to upload any extension. if i use normal upload method i get JFolder::create: Could not create directory
Unable to create destination
if i use upload from directory i get Copy failed
JInstaller: :Install: Failed to copy file
i have tried so many solutions found in joomla support forum but none worked for me.
in desperation i even changed tmp ermissions into 777 and now directory permissions (i know its bad) list shows that tmp is writable but show the warning The PHP temporary directory is not writeable by the Joomla! instance, which may cause issues when attempting to upload extensions to Joomla!. If you are having issues uploading extensions, check the '/tmp' and set it to be writeable and see if this fixes the issue. in extensions manager-> warnings
i was wondering whether open_basedir in defect. In my php info file i have
/srv/www/vhosts/domain/httpdocs/:/tmp/ - no value . how can i know open_basedir is in defect? and how can i solve this extensions matter?
The problem may be because upload_tmp_dir isn't set in php.
Look in SITE > SYSTEM INFORMATION > PHP INFORMATION and check if upload_tmp_dir has been set. If not, you need to edit php.ini
On our servers (which use open base dir), the setting is:
upload_tmp_dir=/tmp
This value could be different for you, depending on your server configuration.
Set permission to 777
use full path for logs and tmp e.g.:
/var/www/vhosts/mydomain/httpdocs/tmp
In the Joomla Backend, go to:
Site >> System Information >> Directory Permissions
and see if the "tmp" folder says "Writable"
I had the same problem with one of my shared hosts. The issue was that even though I had set literally everything to 777 (purely for testing purposes), I didn't have file ownership. If this is the case for you too, then you will have to talk to your hosting provider.

Categories