M
M
MrLincomins2022-03-07 10:32:30
PHP
MrLincomins, 2022-03-07 10:32:30

How to put php libraries in docker-compose?

Hello, I've run into a problem: I uploaded all project files to docker via compose, and php gives an error for using the mysqli_connect() function. As I understand it, I installed pure php, how can I add libraries like mysql

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2022-03-07
@MrLincomins

distribution dependent, for debian based linux distributions

FROM php:7.4-fpm
RUN apt-get update && apt-get install -y \
        libmcrypt-dev \
        libxml2-dev \
        zlib1g-dev \
        libzip-dev \
        mariadb-client \
        git
RUN pecl install xdebug-2.9.6 && docker-php-ext-enable xdebug
RUN pecl install mcrypt-1.0.3 && docker-php-ext-enable mcrypt
RUN docker-php-ext-install pdo_mysql iconv mysqli zip
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question