php Wordpress 错误:发生了 TimThumb 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9833697/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 07:44:04  来源:igfitidea点击:

Wordpress Error: A TimThumb error has occured

phpwordpress

提问by user1287395

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.

将 wordpress 安装到新域后遇到错误。我已经联系了主题开发人员,但没有成功解决该问题。

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
警告:touch() [function.touch]:Utime 失败:第 190 行 /home/domain/public_html/wp-content/themes/folioway/core/thumb.php 中的权限被拒绝警告:无法修改标题信息 - 标题已发送通过(输出开始于 /home/domain/public_html/wp-content/themes/folioway/core/thumb.php:190)在 /home/domain/public_html/wp-content/themes/folioway/core/thumb.php第 413 行发生了 TimThumb 错误 发生了以下错误: 可以注意创建 index.html 文件。查询字符串:src=/wp-content/uploads/2012/03/CoffeetabeBox-custom_web1.jpg&w=187&h=187&zc=1&q=90 TimThumb 版本:2.8.2

I have not modified anything else aside from some CSS.

除了一些 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.

我已将缓存文件夹的权限设置为 777,但这并没有解决问题。

Any help would be greatly appreciates. Thanks.

任何帮助将不胜感激。谢谢。

回答by Sergi Marzabal

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.

如果您没有时间找出原因,但又想让它继续工作,只需重命名或删除您的 /cache 文件夹;然后,创建一个全新的/cache文件夹,将权限设置为777,它会再次工作。

回答by Dave Hilditch

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.

我发现它所指的缓存文件夹与 timthumb.php 位于同一文件夹中 - 找到该文件和相关的缓存文件夹,并为缓存文件夹提供 777 权限。

回答by Supun Sameera

if you are on a linux based server,

如果您使用的是基于 Linux 的服务器,

first find the FILE_CACHE_DIRECTORY from the config file by (ex. in linux server open the file in vi commond)

首先从配置文件中找到FILE_CACHE_DIRECTORY(例如在linux服务器中在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,

因此,我们将缓存文件夹所有权更改为用户“www-data”,这是运行此 php 代码的 Apache Web 服务器的默认用户,

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)

另外,现在更好地检查文件夹是否也可以写(chmod 权限为 777)

回答by Michael

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

不要像其他人建议的那样使用 777,而是将 755 用于 /cache 文件夹。

回答by Pawnesh Kumar

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.

我只是删除缓存文件夹并刷新代码所在的页面,它开始工作。我认为是文件权限的问题。

回答by user714

I added this to a php.ini file:

我将此添加到 php.ini 文件中:

 display_errors = Off
 display_warnings = Off
 output_buffering = On

回答by ryanrain

TimThumb is a separate open source project that is used by many WP plugins.

TimThumb 是一个独立的开源项目,被许多 WP 插件使用。

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

如果更新文件夹权限对您不起作用,另一个对我有用的解决方案是使用最新版本更新插件的 TimThumb 脚本。你可以在这里下载:https: //timthumb.googlecode.com/svn/trunk/timthumb.php

In my case this file was in wp-content/plugins/events-manager/includes/thumbnails

就我而言,此文件位于 wp-content/plugins/events-manager/includes/thumbnails

回答by Craig Lambie

For others that have this issue when using the FiatLux Wordpress Theme, as I am here is the solution:

对于在使用FiatLux Wordpress Theme遇到此问题的其他人,我在这里是解决方案:

  1. Open FTP like Filezilla
  2. Navigate to yoursite/wp-content/themes/fiatlux/includes*
  3. Delete the cache folder
  4. Recreate the cache folder, with permission setting 755
  5. Download the updated timthumb.php file from GitHuband replace (I renamed the old one timthumb.old to test
  6. If you use a Media server/ CDN, then be sure to add that site to the $ALLOWEDSITES array in TimThumb.php file
  1. 像 Filezilla 一样打开 FTP
  2. 导航到 yoursite/wp-content/themes/fiatlux/includes*
  3. 删除缓存文件夹
  4. 重新创建缓存文件夹,权限设置为 755
  5. 从 GitHub下载更新的timthumb.php 文件并替换(我将旧的 timthumb.old 重命名为测试
  6. 如果您使用媒体服务器/CDN,请确保将该站点添加到 TimThumb.php 文件中的 $ALLOWEDSITES 数组中

*If using another Wordpress theme, then find the TimThumb.php file and corresponding cache folder in that theme/ plugins folder in wp-content

*如果使用其他 Wordpress 主题,则在 wp-content 中的该主题/插件文件夹中找到 TimThumb.php 文件和相应的缓存文件夹

回答by Gareth Davies

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

已发送的标头通常是文件开头或结尾处有空格的症状 - 检查 timthumb.php 并确保在之前没有空行或空格

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.

另一种可能性是 /wp-content/uploads/ 不能被网络服务器写入,但我相信第一个是原因。

回答by Kalvin

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

尝试放一个“?” .jpg 和 &w 之间,所以它会是这样的

src=/wp-content/uploads/2012/03/CoffeetabeBox-custom_web1.jpg?&w=187&h=187&zc=1&q=90