【问题标题】:Warning: imagesx() expects parameter 1 to be resource, null given in Drupal警告:imagesx() 期望参数 1 是资源,在 Drupal 中给出 null
【发布时间】:2018-09-28 05:46:02
【问题描述】:

我安装了一个新的 Drupal。当我为文章创建内容时,图片不一般。最近的日志显示

【问题讨论】:

  • 请检查sites/default/files是否可以被www-data写入。
  • 请检查huashuo520.cn/admin/reports/status 是否有任何错误或警告并修复它们。
  • 我的 php 运行器是 webuser .so sites/default/files 是 webuser 并且权限是 777

标签: image drupal thumbnails


【解决方案1】:

您的 GD 缺少 JPEG 支持。如果您在 docker 环境中安装 PHP,您需要安装 libjpeg-dev、libfreetype6-dev 和

docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/

如果您在任何托管环境中使用 PHP,请咨询您的托管服务提供商。我的看起来像

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.6.3
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.6.28
WBMP Support => enabled
XBM Support => enabled

【讨论】:

    【解决方案2】:

    使用

    RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/
    

    使用 php 7.4

    【讨论】:

      猜你喜欢
      • 2012-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-04
      • 2018-01-05
      • 1970-01-01
      • 2011-10-30
      • 2011-08-28
      相关资源
      最近更新 更多