PDOException in TNTSearch.php line 88: could not find driver

0

After running

  • docker-compose down
  • docker-compose up -d --build --force-recreate

I had the following error:

    NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php7/modules/pdo_sqlite.so' - Error relocating /usr/lib/php7/modules/pdo_sqlite.so: zend_empty_string: symbol not found in Unknown on line 0

With this, TNTSearch stopped working at once.

Weuseambientum.Isitpossibletochangephp.ini?I'mhavingalotofdifficulties.

MyDockerFileisinthe./docker/php7.0-nginx/Dockerfilefolderandlookslikethis:

# Ambientum
#
# Repository:    PHP
# Image:         PHP-FPM + Nginx
# Version:       7.1.x
# Strategy:      PHP From PHP-Alpine Repository (CODECASTS) + Official Nginx
# Base distro:   Alpine 3.5
#
# Inspired by official PHP images.
#
FROM ambientum/php:7.1

# Repository/Image Maintainer
MAINTAINER Diego Hernandes <[email protected]>

# Reset user to root to allow software install
USER root

# Copy nginx and entry script
COPY nginx.conf /etc/nginx/nginx.conf
COPY start.sh  /home/ambientum/start.sh

# Install nginx from dotdeb (already enabled on base image)
RUN echo "--> Alpine linux repositories" && \
    echo "http://dl-cdn.alpinelinux.org/alpine/v3.6/main" >> /etc/apk/repositories && \
    echo "http://dl-2.alpinelinux.org/alpine/v3.6/main" >> /etc/apk/repositories && \
    echo "http://dl-3.alpinelinux.org/alpine/v3.6/main" >> /etc/apk/repositories && \
    echo "http://dl-4.alpinelinux.org/alpine/v3.6/main" >> /etc/apk/repositories && \
    echo "http://dl-5.alpinelinux.org/alpine/v3.6/main" >> /etc/apk/repositories && \
    echo "http://dl-2.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
    echo "http://dl-3.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
    echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
    echo "http://dl-5.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
    echo "--> Installing Nginx" && \
    apk add --update --update-cache --allow-untrusted nginx \
      php7-dom \
      php7-sqlite3 \
      php7-pdo_sqlite \
      pngquant \
      gifsicle \
      perl \
      jpegoptim && \
    echo "--> Fixing permissions" && \
    mkdir /var/run/nginx && \
    chown -R ambientum:ambientum /var/run/nginx && \
    chown -R ambientum:ambientum /var/log/nginx && \
    chown -R ambientum:ambientum /var/lib/nginx && \
    chmod +x /home/ambientum/start.sh && \
    chown -R ambientum:ambientum /home/ambientum && \
    mkdir /var/tmp/nginx/client_body && \
    chown -R ambientum:ambientum /var/tmp/nginx
    # rm -rf /tmp/* /var/tmp/* /usr/share/doc/*

# Define the running user
USER ambientum

# Application directory
WORKDIR "/var/www/app"

# Expose webserver port
EXPOSE 8080

# Starts a single shell script that puts php-fpm as a daemon and nginx on foreground
CMD ["/home/ambientum/start.sh"]

And docker-compose.yml

# v2 syntax
version: '2'

# Named volumes
volumes:
  # Redis Data
  oemshop-redis-data:
    driver: local

services:
  # PHPMyAdmin
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: viseu-phpmyadmin
    ports:
      - "8000:80"
    links:
      - mysql
    environment:
      PMA_ARBITRARY: 1
      MYSQL_USER: root
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: password

  # MySQL (5.7)
  mysql:
    build: ./docker/mysql-5.7
    image: ambientum/mysql:5.7
    container_name: container_name-mysql
    volumes:
      - ./storage/app/mysql:/var/lib/mysql
      - ./storage/app/mysql/log:/var/log/mysql
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=name_db
      - MYSQL_USER=root
      - MYSQL_PASSWORD=password

  # Redis
  cache:
    image: ambientum/redis:3.2
    container_name: container_name-redis
    command: --appendonly yes
    volumes:
      - container_name-redis-data:/data/redis
    ports:
      - "6379:6379"

  # PHP (with Caddy)
  app:
    build: ./docker/php7.0-nginx
    image: ambientum/php:7.0-nginx
    container_name: container_name-app
    volumes:
      - .:/var/www/app
      - ./nginx:/etc/nginx/conf.d
      - ./certs:/etc/nginx/certs
    ports:
      - "80:8080"
      - "443:8043"
    links:
      - mysql
      - cache

  # Laravel Queues
  # queue:
    # image: ambientum/php:7.0
    # container_name: container_name-queue
    # command: php artisan queue:listen
    # volumes:
    #   - .:/var/www/app
    # links:
    # - mysql
    # - cache
    
asked by anonymous 19.04.2018 / 16:36

1 answer

0

I'm not sure which server to use, if it is based on Ubuntu or Debian to install use the command:

apt-get install php-sqlite3

If Alpine even uses:

apk add php7-sqlite3

You may need to restart php-fpm, if it is Debian or Ubuntu use (if it is global):

php-fpm restart

If Alpine does this, link :

Run inside the container:

kill -USR2 1

If it is run out of the container, then the command is this:

docker exec -it <troque isto pelo nome do container> kill -USR2 1
    
23.04.2018 / 23:22