Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble to use php-redis #64

Open
Stefan39 opened this issue Oct 4, 2023 · 3 comments
Open

Trouble to use php-redis #64

Stefan39 opened this issue Oct 4, 2023 · 3 comments
Labels

Comments

@Stefan39
Copy link

Stefan39 commented Oct 4, 2023

Hi Dave,

I'm using your docker-files and activate php-redis with PHP_ENABLE_REDIS=true on the environment. But if I'm login into bash and execute a php script i got the following error:

$ bin/console help
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20220829/redis.so (/usr/lib/php/20220829/redis.so: undefined symbol: igbinary_serialize), /usr/lib/php/20220829/redis.so.so (/usr/lib/php/20220829/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Have you any idea?

@Stefan39 Stefan39 added the bug label Oct 4, 2023
@tiredofit
Copy link
Owner

Can you tell me what image tag you are using?

@Stefan39
Copy link
Author

Stefan39 commented Oct 5, 2023

Hi Dave,

Dockerfile:

FROM tiredofit/nginx-php-fpm:debian-8.2

# additional ENV vars
ENV NODE_VERSION=20.5.1
ENV NVM_DIR=/root/.nvm

# Install NVM for node
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
RUN . "$NVM_DIR/nvm.sh" \
    && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" \
    && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" \
    && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"

# Install npm and yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update \
    && apt install vim nodejs yarn -y

RUN php-ext enable redis \
    && php-ext enable calendar \
    && php-ext enable zip

docker-compose.yml:

services:

  php:
    build: ./docker
    container_name: "${PROJECT_NAME}-app"
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=web"
      - "traefik.http.routers.${PROJECT_NAME}.rule=Host(`${PROJECT_NAME}.${DOMAIN_SUFFIX}`)"
    env_file:
      - ./.env
    ports:
      - "9003:9003"
    volumes:
      # Source code
      - ./app:/www/html
    networks:
      frivol:
      web:
        aliases:
          - "${PROJECT_NAME}.${DOMAIN_SUFFIX}"
networks:
  frivol:
    driver: bridge
  web:
    external: true

my .env:

PROJECT_NAME=admin
DOMAIN_SUFFIX=docker.localhost
TRAEFIK_PATH=../traefik

PHP_IDE_CONFIG="serverName=${PROJECT_NAME}.${DOMAIN_SUFFIX}"

NGINX_WEBROOT=/www/html/public
PHP_ENABLE_REDIS=true
PHP_ENABLE_IGBINARY=true
PHP_ENABLE_XDEBUG=true
PHP_MEMORY_LIMIT=2G
PHP_XDEBUG_MODE=develop
PHP_XDEBUG_CLIENT_HOST=host.docker.internal
PHP_XDEBUG_CLIENT_PORT=9003

@tiredofit
Copy link
Owner

OK, there is definitely something wrong here with the build system! I just pulled those images myself and found it's giving me 7.4.2 which is from February. 7.6.15 is the latest. I'm heading out for a few days into the woods, and will keep this as a TODO for when I return Monday. It should be a quick fix. In meantime, did you want to try this tag: 8.2-debian-bullseye - I believe this should give you immediate results. I'm going off this reference: https://hub.docker.com/r/tiredofit/nginx-php-fpm/tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants