APCu is not enabled ? Cant create fixtures

Hello I have a problem using the command :

php bin / console d: f: l

*

[Symfony  Component  Cache  Exception  CacheException]
  APCu is not activated

While Symfony 3 recognizes acpu extension very well …
For information, I am on docker and I have successfully installed the ACPu extension

Symfony detects the cache well but I don’t know why the script doesn’t want to start. I tried to take inspiration from other DockerFile but still the same problem …

My php DockerFile :

    FROM php:7.2-fpm-alpine

MAINTAINER Zakariae Filali <[email protected]>
ARG TIMEZONE
ENV WORKDIR "/var/www/symfony"
ENV EXT_APCU_VERSION=5.1.17
RUN apk upgrade --update && apk --no-cache add 
    git autoconf tzdata openntpd libcurl curl-dev coreutils 
    libmcrypt-dev freetype-dev libxpm-dev libjpeg-turbo-dev libvpx-dev 
    libpng-dev libressl-dev libxml2-dev postgresql-dev icu-dev 
    yarn

RUN docker-php-source extract 
    # ext-apcu
    && mkdir -p /usr/src/php/ext/apcu 
    && curl -fsSL https://github.com/krakjoe/apcu/archive/v$EXT_APCU_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/apcu --strip 1 
    && docker-php-ext-install apcu 
    # cleanup
    && docker-php-source delete

RUN apk add --update --no-cache --virtual .build-dependencies $PHPIZE_DEPS 
        && pecl install apcu 
        && docker-php-ext-enable apcu 
        && pecl clear-cache 
        && apk del .build-dependencies

RUN apk add --no-cache --virtual build-dependencies icu-dev libxml2-dev freetype-dev libpng-dev libjpeg-turbo-dev g++ make autoconf

RUN docker-php-ext-configure intl 
    && docker-php-ext-configure opcache 
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ 
    --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ 
    --with-xpm-dir=/usr/include/

RUN docker-php-ext-install -j$(nproc) gd iconv pdo pdo_mysql pdo_pgsql curl 
    bcmath mbstring json xml xmlrpc zip intl opcache


RUN yes '' | pecl install -f mcrypt
RUN echo "extension=mcrypt.so" > /usr/local/etc/php/conf.d/mcrypt.ini

RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && echo ${TIMEZONE} > /etc/timezone 
&& printf '[PHP]ndate.timezone = "%s"n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini 
&& "date"


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


RUN rm -rf /var/cache/apk/* 
    && find / -type f -iname *.apk-new -delete 
    && rm -rf /var/cache/apk/*

RUN mkdir -p ${WORKDIR}
RUN chown www-data:www-data -R ${WORKDIR}
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") 
    && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/$version 
    && mkdir -p /tmp/blackfire 
    && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire 
    && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so 
    && printf "extension=blackfire.sonblackfire.agent_socket=tcp://blackfire:8707n" > $PHP_INI_DIR/conf.d/blackfire.ini 
    && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz


WORKDIR ${WORKDIR}

CMD ["php-fpm"]

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *