Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
phpThumb写入测试失败_Php_Caching_Permissions_Phpthumb - Fatal编程技术网

phpThumb写入测试失败

phpThumb写入测试失败,php,caching,permissions,phpthumb,Php,Caching,Permissions,Phpthumb,我正试图在Godaddy Windows中部署我的PHP网站,并与IIS7共享托管。 我的网站使用phpThumb库生成拇指图像 但是拇指图像没有显示,我得到: 用法:/###########/filename.jpg有关详细信息,请阅读用法注释 当我检查phpThumb.demo.check.php时,缓存写测试出现红色错误,如下所示 D: / Hosting / ########### / cache / 6 / 67 / 67c / 67c4 / phpThumb_cache_######

我正试图在Godaddy Windows中部署我的PHP网站,并与IIS7共享托管。 我的网站使用phpThumb库生成拇指图像

但是拇指图像没有显示,我得到:

用法:/###########/filename.jpg有关详细信息,请阅读用法注释

当我检查
phpThumb.demo.check.php
时,缓存写测试出现红色错误,如下所示

D: / Hosting / ########### / cache / 6 / 67 / 67c / 67c4 / phpThumb_cache_########__raw67c44e91c46b79493d95da579a7fef28_par52b4fbd9e2256843fcdbe9d1f35f2875.jpeg
directory does NOT exist (before EnsureDirectoryExists())
directory does NOT exist (after EnsureDirectoryExists())
write test FAILED
目录
D:/Hosting//code>缓存已经存在,并且已经从godaddy文件管理器更改为可写

但我注意到“缓存目录”和“临时目录”检查结果都是“存在/可读/可写”


为什么phpThumb给出“写测试失败”,尽管缓存目录存在/可读/可写?当我检查缓存文件夹时,会创建
CacheStart.txt
文件。

对于Godaddy windows共享主机,我做了以下更改并为我工作。也许还有其他更好的解决办法,但我只是尝试快速改变来为我工作

在phpthumb.functions.php//中,它将修复在cache dir中创建子文件夹的问题,如果没有它,则不会生成可选的缓存

static function EnsureDirectoryExists($dirname) {
    $dirname = str_replace('/', DIRECTORY_SEPARATOR, $dirname);  //added for godaddy
    $directory_elements = explode(DIRECTORY_SEPARATOR, $dirname);
    $startoffset = 5;  //added for godaddy

    /*  comment for godaddy
    $startoffset = (!$directory_elements[0] ? 2 : 1);  // unix with leading "/" then start with 2nd element; Windows with leading "c:\" then start with 1st element
    $open_basedirs = preg_split('#[;:]#', ini_get('open_basedir'));
    foreach ($open_basedirs as $key => $open_basedir) {
        if (preg_match('#^'.preg_quote($open_basedir).'#', $dirname) && (strlen($dirname) > strlen($open_basedir))) {
            $startoffset = count(explode(DIRECTORY_SEPARATOR, $open_basedir));
            break;
        }
    }
    */
    $i = $startoffset;
    .....
在phpthumb.class.php//它是必需的,如果没有它,sourcefilepath会出错

function ResolveFilenameToAbsolute($filename) {
    ....
    if ($this->iswindows) {
        //$AbsoluteFilename = preg_replace('#^'.preg_quote(realpath($this->config_document_root)).'#i', realpath($this->config_document_root), $AbsoluteFilename);
        $AbsoluteFilename = str_replace(DIRECTORY_SEPARATOR, '/', $AbsoluteFilename);
    .....