skip to Main Content

Default value (local value)

pdo_mysql.default_socket 

is null.
I want to address Dockerfile when it comes up
enter image description here

My DockerFile:

FROM php:7.4-fpm
RUN apt-get -y update 
        && apt-get install -y libicu-dev 
                libxml2-dev 
                libzip-dev 
                libpng-dev 
                libwebp-dev 
                libjpeg-dev 
                libxpm-dev 
                libfreetype6-dev 
                libjpeg62-turbo-dev 
                zip 
                unzip 
                nano 
        && docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-freetype 
        && docker-php-ext-configure intl 
        && docker-php-ext-install mysqli intl pdo pdo_mysql soap opcache zip gd bcmath sockets

COPY ./ioncube_loader_lin_7.4.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902
RUN docker-php-ext-enable ioncube_loader_lin_7.4.so
RUN chown -R www-data:www-data /var/www

2

Answers


  1. Chosen as BEST ANSWER

    I found the solution:

    first create the custom-php.ini and set value such as:

    [php]
    pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock
    

    Then we add this file to Docker example

    ADD ./custom-php.ini /usr/local/etc/php/conf.d/custom-php.ini
    

  2. You are installing but not enabling it.
    Please add additional RUN command into your Dockerfile:

    RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
    

    As stated from documentations, PHP extensions need to be both installed and enabled: https://hub.docker.com/_/php

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search