Linux and Oracle Instant Client

风格不统一 提交于 2021-01-07 02:42:06

问题


I reworked my question to better target the problem, which I am discussing here.

I have been trying for 4 days to:

  • Deploy Oracle Instant Client with Docker. I can give you the Dockerfile but it is 96 lines

  • To use Oracle Instant Client on my Linux Ubuntu latest.

In the end I arrive at the same two issues.

When installing OCI 8 with the command:

  • Docker:

RUN echo 'instantclient, / usr / local / instantclient' | pecl install oci8

  • Ubuntu:

echo "instantclient, / opt / oracle / instantclient_12_2" | sudo pecl install oci8

I get the error:

make: *** [Makefile: 194: oci8.lo] Error 1
ERROR: `make 'failed

And i try this :

apt-get install -y systemtap-sdt-dev
export PHP_DTRACE=yes
pear download pecl/oci8
tar xvzf oci8-3.0.0.tgz
cd oci8-3.0.0/
phpize
./configure --with-oci8=instantclient,/opt/oracle/instantclient_12_2/
make

Same issue :

make: *** [Makefile:194: oci8.lo] Error 1

Could not find a solution.

Make is correctly installed in both cases:

GNU Make 4.2.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. GPLv3 + license: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

And i follow instructions for install Oracle Instant Client

Do you have an idea ? It blocks me for the rest of my work, and I'm going crazy...

BR,

Nicolas.


回答1:


I found a solution to install OCI locally.

Version 3.0.0 is reserved for PHP 8.

With version 2.2.0 the installation goes smoothly!

apt-get install -y systemtap-sdt-dev
export PHP_DTRACE=yes
pear download pecl/oci8-2.2.0
tar xvzf oci8-2.2.0.tgz
cd oci8-2.2.0/
phpize
./configure --with-oci8=instantclient,/opt/oracle/instantclient_12_2/
make

I'm trying with Docker and changing my answer if it works fine.




回答2:


For Docker i use :

# Oracle instantclient
RUN export PHP_DTRACE=yes
ADD instantclient-basic-linux.x64-12.2.0.1.0.zip /tmp/
ADD instantclient-sdk-linux.x64-12.2.0.1.0.zip /tmp/
RUN unzip /tmp/instantclient-basic-linux.x64-12.2.0.1.0.zip -d /usr/local/
RUN unzip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip -d /usr/local/
RUN mv /usr/local/instantclient_12_2 /usr/local/instantclient
RUN ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so
RUN ln -s /usr/local/instantclient/libocci.so.12.1 /usr/local/instantclient/libocci.so

ENV LD_LIBRARY_PATH=/usr/local/instantclient

RUN echo "instantclient,/usr/local/instantclient"| pecl install oci8-2.2.0


来源:https://stackoverflow.com/questions/65124167/linux-and-oracle-instant-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!