0

私は自分のPHPWebサイトをIIS7とのGodaddyWindows共有ホスティングにデプロイしようとしています。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 / ########### /キャッシュはすでに存在し、godaddyファイルマネージャーから書き込み可能としてすでに変更されています。

しかし、「キャッシュディレクトリ」と「一時ディレクトリ」の両方のチェック結果が「存在/読み取り可能/書き込み可能」であることに注意してください。

キャッシュディレクトリが存在/読み取り/書き込み可能であるのに、phpThumbが「書き込みテストに失敗」するのはなぜですか?そして、キャッシュフォルダをチェックするとCacheStart.txtファイルが作成されます。

4

1 に答える 1

0

GoDaddy Windows共有ホスティングの場合、以下の変更を行い、作業を行いました。他のより良い解決策があるかもしれませんが、私は私のために働くためにただ迅速な変更を試みます。

at phpthumb.functions.php //キャッシュディレクトリにサブフォルダを作成する問題を修正します。オプションでは、キャッシュが生成されません。

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

at 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);
    .....
于 2013-06-15T17:33:15.427 に答える