├── README.md ├── docker-compose.yml ├── docker-php.conf ├── instantclient ├── 12.2.0.1.0 │ ├── instantclient-basiclite-linux.x64-12.2.0.1.0.zip │ ├── instantclient-sdk-linux.x64-12.2.0.1.0.zip │ └── instantclient-sqlplus-linux.x64-12.2.0.1.0.zip ├── 19.3.0.0.0 │ ├── instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip │ ├── instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip │ └── instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip └── 21.12.0.0.0 │ ├── instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip │ ├── instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip │ └── instantclient-sqlplus-linux.x64-21.12.0.0.0dbru.zip ├── php71 ├── 7.1.16-apache-jessie │ ├── oci-2.1.8 │ │ └── Dockerfile │ └── oci-2.2.0 │ │ └── Dockerfile └── 7.1.30-apache-stretch │ └── oci-2.2.0 │ └── Dockerfile ├── php72 └── Dockerfile ├── php8.2-apache-oci8 └── Dockerfile ├── php82 └── Dockerfile └── www └── ocitest.php /README.md: -------------------------------------------------------------------------------- 1 | # PHP image with Oracle Instant Client and OCI8 2 | This Docker image is based on [official PHP images](https://hub.docker.com/_/php/) and includes the Oracle Instant Client and OCI8 PHP extension. This integration allows connectivity to an Oracle database within the PHP environment. 3 | 4 | ## Getting Started 5 | Follow these instructions to set up and run the PHP image with Oracle OCI8: 6 | 7 | ### Clone the repository: 8 | ``` 9 | git clone https://github.com/adrianharabula/php-oci8.git 10 | cd php-oci8 11 | ``` 12 | 13 | ### Build and Run the Docker image: 14 | ``` 15 | cd php8.2-apache-oci8 16 | docker build -t php82 . 17 | cd .. 18 | docker compose up -d 19 | ``` 20 | 21 | ### Open your web browser and visit http://localhost:8181/ocitest.php. You should see: 22 | ``` 23 | PHP Version: 8.2.13 24 | Client Version: 21.12.0.0.0 25 | Server Version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production 26 | ``` 27 | 28 | Feel free to customize the configuration or explore additional features based on your requirements. 29 | 30 | # Contributing 31 | If you have improvements or suggestions, feel free to submit a pull request. 32 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | oracledb: 5 | image: wnameless/oracle-xe-11g-r2 6 | ports: 7 | - "1521:1521" 8 | 9 | php7-with-oci8: 10 | depends_on: 11 | - oracledb 12 | image: php82 13 | volumes: 14 | - ./www:/var/www/html 15 | ports: 16 | - "8181:80" 17 | 18 | -------------------------------------------------------------------------------- /docker-php.conf: -------------------------------------------------------------------------------- 1 | 2 | SetHandler application/x-httpd-php 3 | 4 | 5 | DirectoryIndex disabled 6 | DirectoryIndex index.php index.html 7 | 8 | 9 | # Options -Indexes 10 | AllowOverride All 11 | 12 | -------------------------------------------------------------------------------- /instantclient/12.2.0.1.0/instantclient-basiclite-linux.x64-12.2.0.1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/12.2.0.1.0/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -------------------------------------------------------------------------------- /instantclient/12.2.0.1.0/instantclient-sdk-linux.x64-12.2.0.1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/12.2.0.1.0/instantclient-sdk-linux.x64-12.2.0.1.0.zip -------------------------------------------------------------------------------- /instantclient/12.2.0.1.0/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/12.2.0.1.0/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -------------------------------------------------------------------------------- /instantclient/19.3.0.0.0/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/19.3.0.0.0/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -------------------------------------------------------------------------------- /instantclient/19.3.0.0.0/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/19.3.0.0.0/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip -------------------------------------------------------------------------------- /instantclient/19.3.0.0.0/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/19.3.0.0.0/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip -------------------------------------------------------------------------------- /instantclient/21.12.0.0.0/instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/21.12.0.0.0/instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip -------------------------------------------------------------------------------- /instantclient/21.12.0.0.0/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/21.12.0.0.0/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip -------------------------------------------------------------------------------- /instantclient/21.12.0.0.0/instantclient-sqlplus-linux.x64-21.12.0.0.0dbru.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianharabula/php-oci8/a10fbd5c664f2b11c037b66e6295f43d86edefd2/instantclient/21.12.0.0.0/instantclient-sqlplus-linux.x64-21.12.0.0.0dbru.zip -------------------------------------------------------------------------------- /php71/7.1.16-apache-jessie/oci-2.1.8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.16-apache-jessie 2 | 3 | #fix for jessie 4 | RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list 5 | 6 | RUN apt-get update && apt-get install -y \ 7 | unzip \ 8 | libfreetype6-dev \ 9 | libjpeg62-turbo-dev \ 10 | libmcrypt-dev \ 11 | libpng-dev \ 12 | libaio1 \ 13 | && docker-php-ext-install -j$(nproc) iconv mcrypt gettext \ 14 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 15 | && docker-php-ext-install -j$(nproc) gd 16 | 17 | RUN curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/docker-php.conf -o /etc/apache2/conf-enabled/docker-php.conf 18 | 19 | RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini 20 | 21 | RUN a2enmod rewrite 22 | 23 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/12.2.0.1.0/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -O 24 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/12.2.0.1.0/instantclient-sdk-linux.x64-12.2.0.1.0.zip -O 25 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/12.2.0.1.0/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -O 26 | 27 | RUN unzip /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local/ 28 | RUN unzip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip -d /usr/local/ 29 | RUN unzip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /usr/local/ 30 | 31 | RUN ln -s /usr/local/instantclient_12_2 /usr/local/instantclient 32 | RUN ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so 33 | RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus 34 | 35 | RUN echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc 36 | RUN echo 'umask 002' >> /root/.bashrc 37 | 38 | RUN echo 'instantclient,/usr/local/instantclient' | pecl install oci8-2.1.8 39 | RUN echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini 40 | 41 | RUN echo "" > /var/www/html/phpinfo.php 42 | 43 | EXPOSE 80 44 | -------------------------------------------------------------------------------- /php71/7.1.16-apache-jessie/oci-2.2.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.16-apache-jessie 2 | 3 | #fix for jessie 4 | RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list 5 | 6 | RUN apt-get update && apt-get install -y \ 7 | unzip \ 8 | libfreetype6-dev \ 9 | libjpeg62-turbo-dev \ 10 | libmcrypt-dev \ 11 | libpng-dev \ 12 | libaio1 \ 13 | && docker-php-ext-install -j$(nproc) iconv mcrypt gettext \ 14 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 15 | && docker-php-ext-install -j$(nproc) gd 16 | 17 | RUN curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/docker-php.conf -o /etc/apache2/conf-enabled/docker-php.conf 18 | 19 | RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini 20 | 21 | RUN a2enmod rewrite 22 | 23 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/12.2.0.1.0/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -O 24 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/12.2.0.1.0/instantclient-sdk-linux.x64-12.2.0.1.0.zip -O 25 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/12.2.0.1.0/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -O 26 | 27 | RUN unzip /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local/ 28 | RUN unzip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip -d /usr/local/ 29 | RUN unzip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /usr/local/ 30 | 31 | RUN ln -s /usr/local/instantclient_12_2 /usr/local/instantclient 32 | RUN ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so 33 | RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus 34 | 35 | RUN echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc 36 | RUN echo 'umask 002' >> /root/.bashrc 37 | 38 | RUN echo 'instantclient,/usr/local/instantclient' | pecl install oci8-2.2.0 39 | RUN echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini 40 | 41 | RUN echo "" > /var/www/html/phpinfo.php 42 | 43 | EXPOSE 80 44 | -------------------------------------------------------------------------------- /php71/7.1.30-apache-stretch/oci-2.2.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.30-apache-stretch 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | unzip \ 5 | libfreetype6-dev \ 6 | libjpeg62-turbo-dev \ 7 | libmcrypt-dev \ 8 | libpng-dev \ 9 | libaio1 \ 10 | && docker-php-ext-install -j$(nproc) iconv mcrypt gettext \ 11 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 12 | && docker-php-ext-install -j$(nproc) gd 13 | 14 | RUN curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/docker-php.conf -o /etc/apache2/conf-enabled/docker-php.conf 15 | 16 | RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini 17 | 18 | RUN a2enmod rewrite 19 | 20 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/19.3.0.0.0/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -O 21 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/19.3.0.0.0/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip -O 22 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/19.3.0.0.0/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip -O 23 | 24 | RUN unzip /tmp/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -d /usr/local/ 25 | RUN unzip /tmp/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip -d /usr/local/ 26 | RUN unzip /tmp/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip -d /usr/local/ 27 | 28 | RUN ln -s /usr/local/instantclient_19_3 /usr/local/instantclient 29 | # fixes error "libnnz19.so: cannot open shared object file: No such file or directory" 30 | RUN ln -s /usr/local/instantclient/lib* /usr/lib 31 | RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus 32 | 33 | RUN echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc 34 | RUN echo 'umask 002' >> /root/.bashrc 35 | 36 | RUN echo 'instantclient,/usr/local/instantclient' | pecl install oci8-2.2.0 37 | RUN echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini 38 | 39 | RUN echo "" > /var/www/html/phpinfo.php 40 | 41 | EXPOSE 80 42 | -------------------------------------------------------------------------------- /php72/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-apache 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | unzip \ 5 | libfreetype6-dev \ 6 | libjpeg62-turbo-dev \ 7 | libpng-dev \ 8 | libaio1 \ 9 | && docker-php-ext-install -j$(nproc) iconv gettext \ 10 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 11 | && docker-php-ext-install -j$(nproc) gd 12 | 13 | COPY docker-php.conf /etc/apache2/conf-enabled/docker-php.conf 14 | 15 | RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini 16 | 17 | RUN a2enmod rewrite 18 | 19 | # Oracle instantclient 20 | ADD instantclient-basiclite-linux.x64-12.2.0.1.0.zip /tmp/ 21 | ADD instantclient-sdk-linux.x64-12.2.0.1.0.zip /tmp/ 22 | ADD instantclient-sqlplus-linux.x64-12.2.0.1.0.zip /tmp/ 23 | 24 | RUN unzip /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local/ 25 | RUN unzip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip -d /usr/local/ 26 | RUN unzip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /usr/local/ 27 | 28 | RUN ln -s /usr/local/instantclient_12_2 /usr/local/instantclient 29 | RUN ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so 30 | RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus 31 | 32 | RUN echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc 33 | RUN echo 'umask 002' >> /root/.bashrc 34 | 35 | RUN echo 'instantclient,/usr/local/instantclient' | pecl install oci8 36 | RUN echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini 37 | 38 | RUN apt-get install nano -y 39 | 40 | RUN echo "" > /var/www/html/phpinfo.php 41 | 42 | EXPOSE 80 43 | -------------------------------------------------------------------------------- /php8.2-apache-oci8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-apache 2 | 3 | # Oracle Instant Client Download links 4 | # https://www.oracle.com/database/technologies/instant-client/downloads.html 5 | ENV INSTANTCLIENT "https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-basic-linux.x64-21.12.0.0.0dbru.zip" 6 | ENV INSTANTCLIENT_SDK "https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip" 7 | ENV SQLPLUS "https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-sqlplus-linux.x64-21.12.0.0.0dbru.zip" 8 | 9 | # Oracle Instant Client ENV Variables 10 | ENV LD_LIBRARY_PATH "/opt/oracle/instantclient" 11 | ENV PATH "$PATH:$LD_LIBRARY_PATH" 12 | 13 | # Install Oracle Instant Client Libraries 14 | # https://docs.oracle.com/en/database/oracle/oracle-database/21/lacli/install-instant-client-using-zip.html 15 | RUN apt-get update && apt-get install -y unzip libaio1 16 | RUN cd /tmp \ 17 | && curl -L $INSTANTCLIENT -O \ 18 | && unzip /tmp/instantclient*.zip -d /opt/oracle/ \ 19 | && rm /tmp/instantclient*.zip \ 20 | && mv /opt/oracle/instantclient_* /opt/oracle/instantclient \ 21 | && echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracleinstantclient.conf \ 22 | && ldconfig 23 | RUN cd /tmp \ 24 | && curl -L $INSTANTCLIENT_SDK -O \ 25 | && unzip /tmp/instantclient-sdk*.zip -d /opt/oracle/ \ 26 | && rm /tmp/instantclient*.zip \ 27 | && mv /opt/oracle/instantclient_*/* /opt/oracle/instantclient 28 | RUN cd /tmp \ 29 | && curl -L $SQLPLUS -O \ 30 | && unzip /tmp/instantclient-sqlplus*.zip -d /opt/oracle/ \ 31 | && rm /tmp/instantclient*.zip \ 32 | && mv /opt/oracle/instantclient_*/* /opt/oracle/instantclient 33 | RUN rmdir /opt/oracle/instantclient_* 34 | 35 | # Add custom PHP extensions/libraries 36 | # Install OCI8 Extension 37 | # https://pecl.php.net/package/oci8 38 | RUN apt-get update && apt-get install -y \ 39 | libfreetype-dev libjpeg62-turbo-dev libpng-dev \ 40 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 41 | && docker-php-ext-install -j$(nproc) iconv gettext gd \ 42 | && echo 'instantclient,/opt/oracle/instantclient' | pecl install oci8 \ 43 | && docker-php-ext-enable oci8 44 | 45 | EXPOSE 80 46 | -------------------------------------------------------------------------------- /php82/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-apache 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | unzip \ 5 | libfreetype-dev \ 6 | libjpeg62-turbo-dev \ 7 | # libmcrypt-dev \ 8 | libpng-dev \ 9 | libaio1 \ 10 | && docker-php-ext-install -j$(nproc) iconv gettext \ 11 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 12 | && docker-php-ext-install -j$(nproc) gd 13 | 14 | RUN curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/docker-php.conf -o /etc/apache2/conf-enabled/docker-php.conf 15 | 16 | RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini 17 | 18 | RUN a2enmod rewrite 19 | 20 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php8-oci8/master/instantclient/21.12.0.0.0/instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip -O 21 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php8-oci8/master/instantclient/21.12.0.0.0/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip -O 22 | RUN cd /tmp && curl -L https://raw.github.com/adrianharabula/php8-oci8/master/instantclient/21.12.0.0.0/instantclient-sqlplus-linux.x64-21.12.0.0.0dbru.zip -O 23 | 24 | RUN unzip /tmp/instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip -d /usr/local/ 25 | RUN unzip /tmp/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip -d /usr/local/ 26 | RUN unzip /tmp/instantclient-sqlplus-linux.x64-21.12.0.0.0dbru.zip -d /usr/local/ 27 | 28 | RUN ln -s /usr/local/instantclient_21_12 /usr/local/instantclient 29 | # fixes error "libnnz19.so: cannot open shared object file: No such file or directory" 30 | RUN ln -s /usr/local/instantclient/lib* /usr/lib 31 | RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus 32 | 33 | RUN echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc 34 | RUN echo 'umask 002' >> /root/.bashrc 35 | 36 | RUN echo 'instantclient,/usr/local/instantclient' | pecl install oci8 37 | RUN echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini 38 | 39 | RUN echo "" > /var/www/html/phpinfo.php 40 | 41 | EXPOSE 80 42 | -------------------------------------------------------------------------------- /www/ocitest.php: -------------------------------------------------------------------------------- 1 | "; 3 | echo "Client Version: " . oci_client_version() . "
"; 4 | $conn = oci_connect('system', 'oracle', 'oracledb/XE'); 5 | if (!$conn) { 6 | $e = oci_error(); 7 | trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); 8 | } else echo "Server Version: " . oci_server_version($conn); 9 | --------------------------------------------------------------------------------