Php 在WordPress上使用timthumb,仍然无法工作:(。请提供帮助。)

Php 在WordPress上使用timthumb,仍然无法工作:(。请提供帮助。),php,wordpress,Php,Wordpress,这是我的网站,timthumb不起作用:“ 我尝试过很多解决方案,但都没有……我还在你的网站上使用了你的提示(http://andrewroycarter.com/wordpress-2/using-timthumb-on-wordpress-multi-user/ ). 但是我无论如何也不能使它工作:)你能帮我解决它吗?谢谢。 我在等你的答复 (Wordpress 3.0.1版)问题是您试图使用timtumb.php调整不在服务器上的图像的大小 调整大小的图像的实际错误如下: 不允许远程主机“

这是我的网站,timthumb不起作用:“ 我尝试过很多解决方案,但都没有……我还在你的网站上使用了你的提示(http://andrewroycarter.com/wordpress-2/using-timthumb-on-wordpress-multi-user/ ). 但是我无论如何也不能使它工作:)你能帮我解决它吗?谢谢。 我在等你的答复


(Wordpress 3.0.1版)

问题是您试图使用timtumb.php调整不在服务器上的图像的大小

调整大小的图像的实际错误如下:

不允许远程主机“ongmat.cz” TimThumb版本:1.14

解决方案是编辑timthumb.php脚本并更改第24行(或其附近)

并添加要从中使用图像的域,例如将ongmat.cz添加到数组中,使其看起来像这样:

  $allowedSites = array (
                'flickr.com',
                'picasa.com',
                'blogger.com',
                'wordpress.com',
                'img.youtube.com',
                'ongmat.cz',
        );
/**
 * TimThumb script created by Ben Gillbanks, originally created by Tim McDaniels and Darren Hoyt
 * http://code.google.com/p/timthumb/
 * 
 * GNU General Public License, version 2
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Examples and documentation available on the project homepage
 * http://www.binarymoon.co.uk/projects/timthumb/
 */

define ('CACHE_SIZE', 250);                                     // number of files to store before clearing cache
define ('CACHE_CLEAR', 5);                                      // maximum number of files to delete on each cache clear
define ('CACHE_USE', FALSE);                            // use the cache files? (mostly for testing)
define ('VERSION', '1.16');                                     // version number (to force a cache refresh)
define ('DIRECTORY_CACHE', './cache');          // cache directory
define ('DIRECTORY_TEMP', './temp');            // temp directory
define ('MAX_WIDTH', 1000);                                     // maximum image width
define ('MAX_HEIGHT', 1000);                            // maximum image height
define ('ALLOW_EXTERNAL', TRUE);                       // allow external website (override security precaution)

// external domains that are allowed to be displayed on your website
$allowedSites = array (
        'flickr.com',
        'picasa.com',
        'blogger.com',
        'wordpress.com',
        'img.youtube.com',
        'ongmat.cz',
);
或者您可以更改此选项(尽管不太安全)

变假为真

前30行应该如下所示:

  $allowedSites = array (
                'flickr.com',
                'picasa.com',
                'blogger.com',
                'wordpress.com',
                'img.youtube.com',
                'ongmat.cz',
        );
/**
 * TimThumb script created by Ben Gillbanks, originally created by Tim McDaniels and Darren Hoyt
 * http://code.google.com/p/timthumb/
 * 
 * GNU General Public License, version 2
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Examples and documentation available on the project homepage
 * http://www.binarymoon.co.uk/projects/timthumb/
 */

define ('CACHE_SIZE', 250);                                     // number of files to store before clearing cache
define ('CACHE_CLEAR', 5);                                      // maximum number of files to delete on each cache clear
define ('CACHE_USE', FALSE);                            // use the cache files? (mostly for testing)
define ('VERSION', '1.16');                                     // version number (to force a cache refresh)
define ('DIRECTORY_CACHE', './cache');          // cache directory
define ('DIRECTORY_TEMP', './temp');            // temp directory
define ('MAX_WIDTH', 1000);                                     // maximum image width
define ('MAX_HEIGHT', 1000);                            // maximum image height
define ('ALLOW_EXTERNAL', TRUE);                       // allow external website (override security precaution)

// external domains that are allowed to be displayed on your website
$allowedSites = array (
        'flickr.com',
        'picasa.com',
        'blogger.com',
        'wordpress.com',
        'img.youtube.com',
        'ongmat.cz',
);

问题是您试图使用timtumb.php来调整不在服务器上的图像的大小

调整大小的图像的实际错误如下:

不允许远程主机“ongmat.cz” TimThumb版本:1.14

解决方案是编辑timthumb.php脚本并更改第24行(或其附近)

并添加要从中使用图像的域,例如将ongmat.cz添加到数组中,使其看起来像这样:

  $allowedSites = array (
                'flickr.com',
                'picasa.com',
                'blogger.com',
                'wordpress.com',
                'img.youtube.com',
                'ongmat.cz',
        );
/**
 * TimThumb script created by Ben Gillbanks, originally created by Tim McDaniels and Darren Hoyt
 * http://code.google.com/p/timthumb/
 * 
 * GNU General Public License, version 2
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Examples and documentation available on the project homepage
 * http://www.binarymoon.co.uk/projects/timthumb/
 */

define ('CACHE_SIZE', 250);                                     // number of files to store before clearing cache
define ('CACHE_CLEAR', 5);                                      // maximum number of files to delete on each cache clear
define ('CACHE_USE', FALSE);                            // use the cache files? (mostly for testing)
define ('VERSION', '1.16');                                     // version number (to force a cache refresh)
define ('DIRECTORY_CACHE', './cache');          // cache directory
define ('DIRECTORY_TEMP', './temp');            // temp directory
define ('MAX_WIDTH', 1000);                                     // maximum image width
define ('MAX_HEIGHT', 1000);                            // maximum image height
define ('ALLOW_EXTERNAL', TRUE);                       // allow external website (override security precaution)

// external domains that are allowed to be displayed on your website
$allowedSites = array (
        'flickr.com',
        'picasa.com',
        'blogger.com',
        'wordpress.com',
        'img.youtube.com',
        'ongmat.cz',
);
或者您可以更改此选项(尽管不太安全)

变假为真

前30行应该如下所示:

  $allowedSites = array (
                'flickr.com',
                'picasa.com',
                'blogger.com',
                'wordpress.com',
                'img.youtube.com',
                'ongmat.cz',
        );
/**
 * TimThumb script created by Ben Gillbanks, originally created by Tim McDaniels and Darren Hoyt
 * http://code.google.com/p/timthumb/
 * 
 * GNU General Public License, version 2
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Examples and documentation available on the project homepage
 * http://www.binarymoon.co.uk/projects/timthumb/
 */

define ('CACHE_SIZE', 250);                                     // number of files to store before clearing cache
define ('CACHE_CLEAR', 5);                                      // maximum number of files to delete on each cache clear
define ('CACHE_USE', FALSE);                            // use the cache files? (mostly for testing)
define ('VERSION', '1.16');                                     // version number (to force a cache refresh)
define ('DIRECTORY_CACHE', './cache');          // cache directory
define ('DIRECTORY_TEMP', './temp');            // temp directory
define ('MAX_WIDTH', 1000);                                     // maximum image width
define ('MAX_HEIGHT', 1000);                            // maximum image height
define ('ALLOW_EXTERNAL', TRUE);                       // allow external website (override security precaution)

// external domains that are allowed to be displayed on your website
$allowedSites = array (
        'flickr.com',
        'picasa.com',
        'blogger.com',
        'wordpress.com',
        'img.youtube.com',
        'ongmat.cz',
);

“不工作”不是问题描述。如果您不进行调试并告诉我们具体细节,您就无法回答此问题。“不工作”不是问题描述。如果你不进行调试并告诉我们具体细节,你就无法回答这个问题。那么你可能做错了什么。这肯定是问题所在,因为我以前遇到过。你能发布这个文件的前30行吗:如果(!function_存在('ImageCreateTureColor')){displayError('GD库错误:ImageCreateTureColor不存在-请联系您的网络主机并要求他们安装GD库');}define('CACHE_SIZE',250);define('CACHE_CLEAR',5);define('VERSION','1.14');define('DIRECTORY_CACHE','./CACHE');define('DIRECTORY_TEMP','./TEMP'));$allowedSites=array('flickr.com','picasa.com','blogger.com','wordpress.com','img.youtube.com','ongmat.cz',);对不起,我不能像UAL一样发布。你也可以将图片上传到你自己的博客,并以这种方式链接到它们。我添加了与上面完全相同的内容,但没有发生任何事情:(创建文件的备份副本,然后将代码行替换为我粘贴的代码行,看看这是否解决了问题。如果没有,请放回备份副本,那么您很可能做错了。这肯定是问题所在,因为我以前有过备份副本。您是否可以发布此文件的前30行:如果(!function_存在('ImageCreateTureColor')){displayError('GD库错误:ImageCreateTureColor不存在-请联系您的网络主机并要求他们安装GD库');}define('CACHE_SIZE',250);define('CACHE_CLEAR',5);define('VERSION','1.14');define('DIRECTORY_CACHE','./CACHE');define('DIRECTORY_TEMP','./TEMP');$allowedSites=array('flickr.com','picasa.com','blogger.com','wordpress.com','img.youtube.com','ongmat.cz',);对不起,我不能像ualternative那样发布。你可以将图片上传到你自己的博客并以这种方式链接到它们。我添加了与上面完全相同的内容,但没有发生任何事情:(创建文件的备份副本,然后用我粘贴的代码行替换代码行,看看这是否解决了问题。如果没有,请放回备份副本