Skip to content

Unable to open library 'libvips.so.42' #281

@Danoxv

Description

@Danoxv

@jcupitt, Please tell me why this error might occur

My Dockerfile

FROM php:8.4-fpm


# Install dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
    # Basic packages
    lsb-release apt-transport-https build-essential ca-certificates curl \
    # Exim for sending emails
    #exim4 \
    # PostgreSQL client for db dump/restore
    postgresql-client \
    # VIPS for image processing
    libvips42 libvips-dev \
    # FFMPEG for video processing
    ffmpeg \
    # libzip for zip support
    libzip-dev \
    # ICU for intl
    libicu-dev \
    # oniguruma for mbstring
    libonig-dev \
    # libxml2 for xml, soap
    libxml2-dev \
    # zlib for zip
    zlib1g-dev \
    # libcurl for curl extension
    libcurl4-openssl-dev \
    # libpq for pdo_pgsql extension
    libpq-dev \
    # Git
    git \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install \
    intl \
    mbstring \
    curl \
    xml \
    bcmath \
    pdo \
    pdo_pgsql \
    soap \
    zip \
    ffi

# Install redis extension via PECL
#RUN pecl install redis && docker-php-ext-enable redis

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Configure Exim4 to send emails from the container
#RUN sed -i "s/dc_eximconfig_configtype='local'/dc_eximconfig_configtype='internet'/g" \
#    /etc/exim4/update-exim4.conf.conf && update-exim4.conf

# Add user for the application
# Replace 1000 with the actual User ID if needed
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www

RUN mkdir -p /var/www/var && chmod -R 777 /var/www/var

# Copy application files
#COPY --chown=www:www . /var/www
#RUN chown www:www -R /var/www/storage

# Change user and working directory
USER www
WORKDIR /var/www

# Install PHP dependencies
#RUN composer i --no-interaction --no-progress

# Default command for php-fpm
CMD ["php-fpm"]

I have it installed "jcupitt/vips": "^2.5", to composer

вызываю потом просто


 Image::thumbnail($input, $maxSize, ['size' => 'VIPS_SIZE_DOWN'])
                ->writeToFile($output, $options);

Full error log:

app-1 | NOTICE: PHP message: [critical] Uncaught PHP Exception Jcupitt\Vips\Exception: "Unable to open library 'libvips.so.42'. Make sure that you've installed libvips and that 'libvips.so.42' is on your system's library search path." at FFI.php line 318

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy