Minishop2: изображения, превью

Здравствуйте.

Создаю магазин, используя Minishop2. Отличная и удобная вещь.
Однако, возникла загвоздка: в админке не отображаются превью загруженных к товару фотографий (выдаётся дефолтное изображение). Соответственно, и на фронт-части сайта доп. изображения не выводятся. Причина — не создаётся папка для превью /assets/products/n-product_folder, они не сохраняются. Почему — понять не могу.
Поиском пользовался. Прочинал множкество комментариев, в том числе и эти: https://modx.pro/help/837/ Системные настройки не менял. В источниках файлов всё прописано верно. Права на папку /assets/products — 777.

Подскажите, пожалуйста, в чём может быть дело. Буду очень признателен за помощь.
Александр
06 августа 2015, 09:02
modx.pro
1 736
0

Комментарии: 5

Максим Кузнецов
06 августа 2015, 12:36
0
Вообще, такая ошибка чаще всего бывает при неправильных правах, но если вы точно их проверили, то:
— посмотрите лог ошибок, может быть там всплывает нужные данные
— проверьте настройки соответствующего источника файлов
— возможно, проблема на стороне хостинга

К слову, нет ли проблемы при загрузке изображений с других модулей (например, с tv-поля image)?
    Александр Н
    06 августа 2015, 12:54
    0
    Чаще всего прав достаточно 755
    А как вариант, может не хватать php модулей включенных на хостинге
      Александр
      06 августа 2015, 13:24
      0
      Спасибо большое вам за подсказки.
      Совсем вылетело из головы, что можно посмотреть лог-файл. Вот что туда записалось при попытке загрузить изображение:

      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/processors/mgr/gallery/upload.class.php : 148) PHP warning: file_put_contents(): open_basedir restriction in effect. File(/tmp/ms_VQYERx) is not within the allowed path(s): (/var/www/u8689516/data:.)
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/processors/mgr/gallery/upload.class.php : 148) PHP warning: file_put_contents(/tmp/ms_VQYERx): failed to open stream: Operation not permitted
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/processors/mgr/gallery/upload.class.php : 149) PHP warning: getimagesize(): open_basedir restriction in effect. File(/tmp/ms_VQYERx) is not within the allowed path(s): (/var/www/u8689516/data:.)
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/processors/mgr/gallery/upload.class.php : 149) PHP warning: getimagesize(/tmp/ms_VQYERx): failed to open stream: Operation not permitted
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/processors/mgr/gallery/upload.class.php : 160) PHP warning: unlink(): open_basedir restriction in effect. File(/tmp/ms_VQYERx) is not within the allowed path(s): (/var/www/u8689516/data:.)
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/model/minishop2/msproductfile.class.php : 96) PHP warning: file_put_contents(): open_basedir restriction in effect. File(/tmp/ms_csQY72) is not within the allowed path(s): (/var/www/u8689516/data:.)
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/model/minishop2/msproductfile.class.php : 96) PHP warning: file_put_contents(/tmp/ms_csQY72): failed to open stream: Operation not permitted
      [2015-08-06 14:19:16] (ERROR @ /assets/components/minishop2/connector.php) Could not generate thumbnail for "/assets/images/products/103/04m1.jpg". Array
      (
          [0] => phpThumb() v1.7.13-201406261000 in file "phpthumb.class.php" on line 220
          [1] => setCacheDirectory() starting with config_cache_directory = "/var/www/u8689516/data/www/site.com/core/cache/phpthumb/" in file "phpthumb.class.php" on line 961
          [2] => setting config_cache_directory to realpath(/var/www/u8689516/data/www/site.com/core/cache/phpthumb) = "/var/www/u8689516/data/www/site.com/core/cache/phpthumb" in file "phpthumb.class.php" on line 989
          [3] => setSourceFilename(/tmp/ms_csQY72) set $this->sourceFilename to "/tmp/ms_csQY72" in file "phpthumb.class.php" on line 271
          [4] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 925
          [5] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 936
          [6] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 943
          [7] => $this->thumbnailQuality set to "90" in file "phpthumb.class.php" on line 953
          [8] => ResolveFilenameToAbsolute() prepending $this->config_document_root (/var/www/u8689516/data/www/site.com/) to $filename (/tmp/ms_csQY72) resulting in ($AbsoluteFilename = "/var/www/u8689516/data/www/site.com//tmp/ms_csQY72") in file "modphpthumb.class.php" on line 262
          [9] => $this->sourceFilename set to "/var/www/u8689516/data/www/site.com//tmp/ms_csQY72" in file "phpthumb.class.php" on line 849
          [10] => phpThumb() v1.7.13-201406261000
      http://phpthumb.sourceforge.net
      
      Error messages disabled.
      
      edit phpThumb.config.php and (temporarily) set
      $PHPTHUMB_CONFIG['disable_debug'] = false;
      to view the details of this error in file "phpthumb.class.php" on line 4050
          [11] => SetCacheFilename() _src set from md5($this->sourceFilename) "/var/www/u8689516/data/www/site.com//tmp/ms_csQY72" = "0ed1fab9ceef3df527cfa5fe0aa4a80d" in file "phpthumb.class.php" on line 3443
          [12] => SetCacheFilename() _par set from md5(_bg000000_farC_zc1_h90_w120_dpi150_q90) in file "phpthumb.class.php" on line 3476
          [13] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 3236
          [14] => GetImageSize(/var/www/u8689516/data/www/site.com//tmp/ms_csQY72) says image is x in file "phpthumb.class.php" on line 3246
          [15] => GetImageSize("/var/www/u8689516/data/www/site.com//tmp/ms_csQY72") failed in file "phpthumb.class.php" on line 3279
          [16] => $this->useRawIMoutput=false because "bg" is set in file "phpthumb.class.php" on line 1502
          [17] => $this->useRawIMoutput=false after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1508
          [18] => ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed in file "phpthumb.class.php" on line 2203
          [19] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3286
          [20] => SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 3215
          [21] => SetOrientationDependantWidthHeight() setting w="120", h="90" in file "phpthumb.class.php" on line 3231
          [22] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 3343
          [23] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3603
          [24] => starting ImageCreateFromFilename(/var/www/u8689516/data/www/site.com//tmp/ms_csQY72) in file "phpthumb.class.php" on line 3518
          [25] => empty $filename or GetImageSize(/var/www/u8689516/data/www/site.com//tmp/ms_csQY72) failed in file "phpthumb.class.php" on line 3567
          [26] => Populating $rawimagedata in file "phpthumb.class.php" on line 3575
          [27] => cannot fopen(/var/www/u8689516/data/www/site.com//tmp/ms_csQY72) in file "phpthumb.class.php" on line 3586
          [28] => Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3674
          [29] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3726
          [30] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3728
          [31] => phpThumb() v1.7.13-201406261000
      http://phpthumb.sourceforge.net
      
      Error messages disabled.
      
      edit phpThumb.config.php and (temporarily) set
      $PHPTHUMB_CONFIG['disable_debug'] = false;
      to view the details of this error in file "phpthumb.class.php" on line 4050
          [32] => SourceImageToGD() failed in file "phpthumb.class.php" on line 351
      )
      
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/model/minishop2/msproductfile.class.php : 96) PHP warning: file_put_contents(): open_basedir restriction in effect. File(/tmp/ms_4jXMpy) is not within the allowed path(s): (/var/www/u8689516/data:.)
      [2015-08-06 14:19:16] (ERROR @ /var/www/u8689516/data/www/site.com/core/components/minishop2/model/minishop2/msproductfile.class.php : 96) PHP warning: file_put_contents(/tmp/ms_4jXMpy): failed to open stream: Operation not permitted
      [2015-08-06 14:19:16] (ERROR @ /assets/components/minishop2/connector.php) Could not generate thumbnail for "/assets/images/products/103/04m1.jpg". Array
      (
          [0] => phpThumb() v1.7.13-201406261000 in file "phpthumb.class.php" on line 220
          [1] => setCacheDirectory() starting with config_cache_directory = "/var/www/u8689516/data/www/site.com/core/cache/phpthumb/" in file "phpthumb.class.php" on line 961
          [2] => setting config_cache_directory to realpath(/var/www/u8689516/data/www/site.com/core/cache/phpthumb) = "/var/www/u8689516/data/www/site.com/core/cache/phpthumb" in file "phpthumb.class.php" on line 989
          [3] => setSourceFilename(/tmp/ms_4jXMpy) set $this->sourceFilename to "/tmp/ms_4jXMpy" in file "phpthumb.class.php" on line 271
          [4] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 925
          [5] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 936
          [6] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 943
          [7] => $this->thumbnailQuality set to "90" in file "phpthumb.class.php" on line 953
          [8] => ResolveFilenameToAbsolute() prepending $this->config_document_root (/var/www/u8689516/data/www/site.com/) to $filename (/tmp/ms_4jXMpy) resulting in ($AbsoluteFilename = "/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy") in file "modphpthumb.class.php" on line 262
          [9] => $this->sourceFilename set to "/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy" in file "phpthumb.class.php" on line 849
          [10] => phpThumb() v1.7.13-201406261000
      http://phpthumb.sourceforge.net
      
      Error messages disabled.
      
      edit phpThumb.config.php and (temporarily) set
      $PHPTHUMB_CONFIG['disable_debug'] = false;
      to view the details of this error in file "phpthumb.class.php" on line 4050
          [11] => SetCacheFilename() _src set from md5($this->sourceFilename) "/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy" = "8d2a141279a2237c4ba6e4f35394e3bc" in file "phpthumb.class.php" on line 3443
          [12] => SetCacheFilename() _par set from md5(_bg000000_farC_zc1_h270_w360_dpi150_q90) in file "phpthumb.class.php" on line 3476
          [13] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 3236
          [14] => GetImageSize(/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy) says image is x in file "phpthumb.class.php" on line 3246
          [15] => GetImageSize("/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy") failed in file "phpthumb.class.php" on line 3279
          [16] => $this->useRawIMoutput=false because "bg" is set in file "phpthumb.class.php" on line 1502
          [17] => $this->useRawIMoutput=false after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1508
          [18] => ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed in file "phpthumb.class.php" on line 2203
          [19] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3286
          [20] => SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 3215
          [21] => SetOrientationDependantWidthHeight() setting w="360", h="270" in file "phpthumb.class.php" on line 3231
          [22] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 3343
          [23] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3603
          [24] => starting ImageCreateFromFilename(/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy) in file "phpthumb.class.php" on line 3518
          [25] => empty $filename or GetImageSize(/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy) failed in file "phpthumb.class.php" on line 3567
          [26] => Populating $rawimagedata in file "phpthumb.class.php" on line 3575
          [27] => cannot fopen(/var/www/u8689516/data/www/site.com//tmp/ms_4jXMpy) in file "phpthumb.class.php" on line 3586
          [28] => Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3674
          [29] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3726
          [30] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3728
          [31] => phpThumb() v1.7.13-201406261000
      http://phpthumb.sourceforge.net
      
      Error messages disabled.
      
      edit phpThumb.config.php and (temporarily) set
      $PHPTHUMB_CONFIG['disable_debug'] = false;
      to view the details of this error in file "phpthumb.class.php" on line 4050
          [32] => SourceImageToGD() failed in file "phpthumb.class.php" on line 351
      )


      Сейчас буду разбираться. Как разберусь, напишу сюда.
      Но, может быть, кто-нибудь с таким сталкивался?
        Василий Наумкин
        06 августа 2015, 13:28
        0
        Путь ко временной директории немного странный — с двойным слешем.
        /var/www/u8689516/data/www/site.com//tmp/ms_csQY72
        Через это, полагаю, файл не может быть создан при загрузке, а потом из него не могут быть сделаны превью.
        [29] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3726
        [30] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3728
        still empty — это «всё еще пустой».
        Александр
        07 августа 2015, 10:05
        +1
        Спасибо всем за внимание.

        Как и предполагал, дело было в настройке сервера. Написал в тех. поддержку; мне ответили, что «Переключили работу сайта в режим fast-cgi для запуска скриптов из-под созданного пользователя. » и затем «Скорректировали владельца каталогов для указанного сайта.».
        После этого всё заработало.

        P.S. Василий, спасибо за Minishop.
          Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
          5