php fix oci8 versions

This commit is contained in:
Adam Ducho 2021-09-10 09:32:43 +02:00
parent bc894b6ee0
commit 70ff1d6da7
2 changed files with 11 additions and 7 deletions

View File

@ -602,9 +602,11 @@ RUN if [ ${INSTALL_OCI8} = true ]; then \
freetds-dev && \ freetds-dev && \
# Install PHP extensions # Install PHP extensions
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \ echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.12; \
else \ elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.2.0; \ echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.2.0; \
else \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
fi \ fi \
&& docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \ && docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
&& docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \ && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \

View File

@ -904,9 +904,11 @@ RUN if [ ${INSTALL_OCI8} = true ]; then \
libaio-dev && \ libaio-dev && \
# Install PHP extensions # Install PHP extensions
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \ echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.12; \
else \ elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.2.0; \ echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.2.0; \
else \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
fi \ fi \
&& echo "extension=oci8.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini \ && echo "extension=oci8.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini \
&& php -m | grep -q 'oci8' \ && php -m | grep -q 'oci8' \