php5 support MSSQL extension

This commit is contained in:
bestlong 2018-06-11 14:23:40 +08:00
parent 66c61d9a72
commit e8eb97b398
2 changed files with 59 additions and 45 deletions

View File

@ -373,6 +373,13 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \
ARG INSTALL_MSSQL=false
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
apt-get -y install freetds-dev libsybdb5 \
&& ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \
&& docker-php-ext-install mssql pdo_dblib \
&& php -m | grep -q 'mssql' \
&& php -m | grep -q 'pdo_dblib' \
;else \
###########################################################################
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image
###########################################################################
@ -390,6 +397,7 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \
&& php -m | grep -q 'pdo_sqlsrv' \
&& php -m | grep -q 'sqlsrv' \
;fi \
;fi
###########################################################################

View File

@ -577,6 +577,11 @@ ARG INSTALL_MSSQL=false
ARG PHP_VERSION=${PHP_VERSION}
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
apt-get -y install php5.6-sybase freetds-bin freetds-common libsybdb5 \
&& php -m | grep -q 'mssql' \
&& php -m | grep -q 'pdo_dblib' \
;else \
###########################################################################
# The following steps were taken from
# https://github.com/Microsoft/msphpsql/wiki/Install-and-configuration
@ -605,6 +610,7 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
echo "extension=pdo_sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \
&& php -m | grep -q 'sqlsrv' \
&& php -m | grep -q 'pdo_sqlsrv' \
;fi \
;fi
###########################################################################