vercel-community / php

🐘 PHP Runtime for ▲ Vercel Serverless Functions (support 7.4-8.3)
https://php.vercel.app
MIT License
1.24k stars 285 forks source link

Extension: pdo_sqlsrv #49

Open vladimirbuskin opened 4 years ago

vladimirbuskin commented 4 years ago

Question

Hello sir, thanks for your great work, if i want to use now-php with pdo_sqlsrv extension, anyway to configure or not supported?

f3l1x commented 4 years ago

Hi @vladimirbuskin. pdo_sqlsrv is not bundled in now-php at this moment. Only extension is needed or any other files?

f3l1x commented 4 years ago

Ping @vladimirbuskin.

vladimirbuskin commented 4 years ago

Hello @f3l1x sorry, i was looking for an ability to use it, but people in my organization can not understand it, and customers want to have something which can be installed on their servers, so i was just digging. Installing that sql server driver, is pretty time space big task, it requires a lot of dependencies in my DockerFile, i am not sure if all those are installed just for compilation or used, didn't try it. Can provide part of the Dockerfile if will help.

RUN apt-get update \
    # microsoft key and 
    && apt-get install -y --no-install-recommends gnupg2 \
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update \
    && apt-get install -y --no-install-recommends \
    # to make "apt-key add" command work
    gnupg2 \
    # to unzip
    unzip \
    # to get jasperserver deps in composer
    git \ 
    # unix odbc, required for pdo_sqlsrv
    unixodbc-dev msodbcsql17 \
    # deps for php extensions
    libicu-dev \
    libpq-dev \
    libxml2-dev \
    zlib1g-dev \
    libpng-dev \
    libjpeg-dev \
    libonig-dev \
    libzip-dev \
    libfreetype6-dev \
    curl\
    pkg-config \
    patch\
    # nano to connect to container to debug
    nano \
    # pdo_sqlsrv
    && pecl install sqlsrv pdo_sqlsrv xdebug \
    && docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug \
f3l1x commented 4 years ago

Thanks @vladimirbuskin. I think it's out of our limits. I mean lambda limits in Vercel. Microsoft sqlserver seems like a big dependency and it might reach our size (50mb) limit. Quite frankly, we can't use pdo_sqlsrv extension at this time.