Merge pull request #1602 from bestlong/php5-mssql-ext-install-faile

php5 support MSSQL extension
This commit is contained in:
Shao Yu-Lung (Allen) 2018-06-11 16:32:50 +08:00 committed by GitHub
commit 5016e88515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 ARG INSTALL_MSSQL=false
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ 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 # 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 \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \
&& php -m | grep -q 'pdo_sqlsrv' \ && php -m | grep -q 'pdo_sqlsrv' \
&& php -m | grep -q 'sqlsrv' \ && php -m | grep -q 'sqlsrv' \
;fi \
;fi ;fi
########################################################################### ###########################################################################

View File

@ -577,6 +577,11 @@ ARG INSTALL_MSSQL=false
ARG PHP_VERSION=${PHP_VERSION} ARG PHP_VERSION=${PHP_VERSION}
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ 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 # The following steps were taken from
# https://github.com/Microsoft/msphpsql/wiki/Install-and-configuration # 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 \ 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 'sqlsrv' \
&& php -m | grep -q 'pdo_sqlsrv' \ && php -m | grep -q 'pdo_sqlsrv' \
;fi \
;fi ;fi
########################################################################### ###########################################################################