How to install/enable pdo-odbc driver on a php docker container?

前端 未结 2 1535
無奈伤痛
無奈伤痛 2021-01-16 07:11

I am currently having trouble writing a Dockerfile for my php application. My Dockerfile works but lacks the pdo-odbc driver I need to connect to an MS SQL Server database.

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-16 07:45

    This worked for me:

    RUN apt-get install unixodbc unixodbc-dev -y \
     && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \
     && docker-php-ext-install pdo_odbc
    

提交回复
热议问题