adrianharabula / php-oci8

Official Docker PHP image with Oracle Instant Client and OCI8
https://hub.docker.com/r/adrianharabula/php7-with-oci8
27 stars 34 forks source link

Unable to run oracle client for 32 bit #8

Closed alpharameeztech closed 7 months ago

alpharameeztech commented 3 years ago

Dockerfile:

FROM php:7.2-apache-stretch

RUN apt-get update && apt-get install -y \
        unzip \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libmcrypt
        libpng-dev \
        libaio1 \
    && docker-php-ext-install -j$(nproc) iconv mcrypt gettext \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd

RUN curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/docker-php.conf -o /etc/apache2/conf-enabled/docker-php.conf

RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini

RUN a2enmod rewrite

RUN cd /tmp && curl -L https://download.oracle.com/otn_software/linux/instantclient/1911000/instantclient-basiclite-linux-19.11.0.0.0dbru.zip -O
RUN cd /tmp && curl -L https://download.oracle.com/otn_software/linux/instantclient/1911000/instantclient-sdk-linux-19.11.0.0.0dbru.zip -O
RUN cd /tmp && curl -L https://download.oracle.com/otn_software/linux/instantclient/1911000/instantclient-sqlplus-linux-19.11.0.0.0dbru.zip -O

RUN unzip /tmp/instantclient-basiclite-linux-19.11.0.0.0dbru.zip -d /usr/local/
RUN unzip /tmp/instantclient-sdk-linux-19.11.0.0.0dbru.zip -d /usr/local/
RUN unzip /tmp/instantclient-sqlplus-linux-19.11.0.0.0dbru.zip -d /usr/local/instantclient_19_11

RUN ln -s /usr/local/instantclient_19_11 /usr/local/instantclient
# fixes error "libnnz19.so: cannot open shared object file: No such file or directory"
RUN ln -s /usr/local/instantclient_19_11/sdk /usr/lib
RUN ln -s /usr/local/instantclient_19_11/instantclient_19_11 /usr/bin/sqlplus

RUN echo 'export LD_LIBRARY_PATH="/usr/local/instantclient_19_11"' >> /root/.bashrc
RUN echo 'umask 002' >> /root/.bashrc

RUN echo 'instantclient_19_11,/usr/local/instantclient_19_11' | pecl install oci8-2.2.0
RUN echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini

RUN echo "<?php echo phpinfo(); ?>" > /var/www/html/phpinfo.php

EXPOSE 80
adrianharabula commented 7 months ago

Hello @alpharameeztech ! I am not sure if you solved your issue or not, but thank you for contributing with the dockerfile above. Here is a more recent build for php8.2 with ideas from your dockerfile. https://github.com/adrianharabula/php-oci8/commit/1bb63cc042e30da722fe13d125d9e2a2713a65df#diff-572e474d18074e4972021e27346279373b5976eeeb92af5f5a9548f49e012fc7

The instant client is now downloaded directly from Oracle site.

Thank you very much! I will close this, feel free to write back or open another issue.