- Как установить oracle client linux
- Ubuntu Documentation
- Introduction
- Install RPMs
- Integrate Oracle Libraries
- ORACLE_HOME
- SDK fix
- 6.2 Installing Oracle Database Instant Client
- 6.2.1 Installing Oracle Database Instant Client on Windows
- 6.2.2 Installing Oracle Database Instant Client on Linux or UNIX
- Как установить oracle client linux
- I. Установка библиотек Oracle Instant Client
- Немного теории про Oracle Instant Client:
- Установка библиотек Oracle Instant Client
- II. Установка oci8 (PECL) для нативной версии php
- III. Установка oci8 (PECL) для альтернативной версии php
Как установить oracle client linux
Learn how to install Oracle Instant Client by downloading the RPMs and using the yum install command.
Starting with 19c, by default, you can install only one version of the Oracle Instant Client RPM packages at a time. If you need multiple versions, use the Oracle Instant Client zip files.
Removing Earlier Oracle Instant Client Installations
Remove any earlier installations of Oracle Instant Client using yum before you start a fresh installation.
List the currently installed Oracle Instant Client packages. For example:
For Oracle Linux 7:
For Oracle Linux 8:
The output will be like:
Remove the Oracle Instant Client packages. For example:
For Oracle Linux 7:
For Oracle Linux 8:
Remove the legacy Oracle Instant Client yum repository setup package. For example:
For Oracle Linux 7:
For Oracle Linux 8:
A reboot is not required.
Installing Oracle Instant Client From the yum Server
If you are using Oracle Linux and have configured your Oracle Linux yum server, then you can install Oracle Instant Client using the yum install command.
Install the Oracle Linux release package to configure repository definitions for Oracle Instant Client:
For Oracle Linux 7:
For Oracle Linux 8:
Go to the Oracle Instant Client repositories to view the available Oracle Instant Client packages:
For Oracle Linux 7:
For Oracle Linux 8:
All installations require a Basic or Basic Light package. All other packages are optional.
Install Oracle Instant Client packages using yum .
For Oracle Linux 7:
For Oracle Linux 8:
To install other Oracle Instant Client packages like SQL*Plus, run:
For Oracle Linux 7:
For Oracle Linux 8:
Using versionlock to Avoid Upgrades
To ensure that you do not inadvertently upgrade Oracle Instant Client when a new major release is published, use yum versionlock after you have installed Oracle Instant Client 21c.
For Oracle Linux 7:
For Oracle Linux 8:
Configuring yum versionlock still allows automatic Oracle Instant Client release updates to 21.2, 21.3, and so on.
Manually Downloading and Installing Oracle Instant Client RPM Packages
An alternative method for installing Oracle Instant Client is to manually download and install the Oracle Instant Client packages.
Go to the Oracle Instant Client Downloads page:
Download the desired Oracle Instant Client RPM packages. Select the correct platform, architecture, and packages of your choice. For example, if your application is 64-bit, then ensure that you select 64-bit Instant Client and download the Basic Package RPM file.
All installations require a Basic or Basic Light package. All other packages are optional.
Install the packages using yum .
For Oracle Linux 7:
For Oracle Linux 8:
Additionally, you may have to perform the following tasks before you start your application:
If you intend to colocate optional Oracle configuration files such as tnsnames.ora , sqlnet.ora , ldap.ora , or oraaccess.xml with Oracle Instant Client, then move these files to the /usr/lib/oracle/21/client64/lib/network/admin subdirectory.
This is the default Oracle configuration directory for applications linked with this Oracle Instant Client.
Alternatively, you can move the Oracle configuration files to another, accessible directory. Then set the environment variable TNS_ADMIN to that directory name.
To use binaries from the tools package, use yum or dnf to install the package and then update your PATH environment variable. For example:
Источник
Ubuntu Documentation
Introduction
Oracle Instant Client is a free Oracle database client. The current version is 12.1.0.2.0, and several versions back to 10.1.0.5 are available.
Install RPMs
Download the Oracle Instantclient RPM files from http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html. Everyone needs either «Basic» or «Basic lite», and most users will want «SQL*Plus» and the «SDK».
Convert these .rpm files into .deb packages and install using «alien» («sudo apt-get install alien» if you don’t have it).
If you execute sqlplus and get «sqlplus: command not found», see the section below about adding the ORACLE_HOME variable.
If sqlplus complains of a missing libsqlplus.so file, follow the steps in the section «Integrate Oracle Libraries» below.
If sqlplus complains of a missing libaio.so.1 file, run
or, if you’re installing the 32 bit instant client on 64 bit,
Integrate Oracle Libraries
If oracle applications, such as sqlplus, are complaining about missing libraries, you can add the Oracle libraries to the LD_LIBRARY_PATH each time it is used:
For example, 12.1 version for Linux x86_64:
or to add it to the system library list create a new file as follows:
- and add the oracle library path as the first line. For example,
ORACLE_HOME
Many Oracle database applications look for Oracle software in the location specified in the environment variable ‘ORACLE_HOME’.
Typical workstations will only have one Oracle install, and will want to define this variable in a system-wide location.
Add the following:
Alternatively, each user can define this in their
Note: From Ubuntu 11.04 (confirmed in 11.04 and 14.04) sqlplus was not recognized as a command unless the following line was also included in the oracle.sh file:
SDK fix
Some packages may look for ‘oci.h’ in $ORACLE_HOME/include, or in $ORACLE_HOME/rdbms/public
The instant client sometimes places the include files, such as oci.h, in /usr/include/oracle/ /client.
Inspect your system by running the following commands
If there is no ‘include’ directory under ORACLE_HOME, and it is located over in /usr/include/oracle/ , create a symbolic link to assist packages looking for these header files. For example,
And then check it is correct
Oracle Instant Client (последним исправлял пользователь J.D. Laub 2015-10-07 18:50:02)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
Источник
6.2 Installing Oracle Database Instant Client
Oracle R Enterprise requires Oracle Database client software.
Oracle Instant Client is suitable for most configurations of Oracle R Enterprise.
This topic includes these sections:
Related Topics
6.2.1 Installing Oracle Database Instant Client on Windows
To Install Oracle Instant Client on Windows:
Create an installation directory for the Oracle R Enterprise client components. For example:
Go to the Oracle Database Instant Client page on the Oracle Technology Network.
Select See Instant Client downloads for all platforms .
On the Instant Client Downloads page, select Instant Client for Microsoft Windows (x64) .
On the Instant Client Downloads for Microsoft Windows (x64) page, accept the license agreement.
Choose Instant Client Package — Basic for your version of Oracle Database.
Save the file in the installation directory that you created in Step 1. For example:
Unzip the file. The files are extracted into a subdirectory called instantclient_ version , where version is your version of Oracle Database. For example:
Return to the Instant Client Downloads for Microsoft Windows (x64) page.
Accept the license agreement and select Instant Client Package — SDK for your version of Oracle Database.
Save the file in the installation directory that you created in Step 1.
Unzip the file. The files are extracted into the instantclient_ version subdirectory.
Add the full path of the Instant Client to the environment variables OCI_LIB64 and PATH . The following steps set the variables to the path used in this example, c:\myoreclient\instantclient_12_1 :
In Windows Control Panel, choose System , then click Advanced system settings .
On the Advanced tab, click Environment Variables .
Under System variables , create OCI_LIB64 if it does not already exist. Set the value of OCI_LIB64 to c:\oreclient\instantclient_12_1 .
Under System variables , edit PATH to include c:\oreclient\instantclient_12_1 .
6.2.2 Installing Oracle Database Instant Client on Linux or UNIX
You can install Oracle Database Instant Client from a zip file on Linux or UNIX systems.
Источник
Как установить oracle client linux
Если у вас есть задача, требующая с помощью php обращаться к базе данных ORACLE, то эта статья для вас.
Мне пришлось прочитать много разных статей в интернете (из которых ни одна не дала результата), кучу технической документации от ORACLE и по php, провести много экспериментов, потом откатить сервер в предыдущее состояние (до экспериментов), чтобы еще раз выполнить установку и подтвердить, что всё корректно.
Данная статья состоит из 3 частей :
I. Установка библиотек Oracle Instant Client.
II. Установка oci8 (PECL) для нативной версии php.
III. Установка oci8 (PECL) для альтернативных версий php.
Исходные данные:
— виртуальный сервер с установленной операционной системой Linux Debian 10 x64;
— панель управления сервером ISP Manager Lite 5.
— нативная версия php7.3
— дополнительно установленные альтернативные версии php: 5.4, 7.1, 7.4.
I. Установка библиотек Oracle Instant Client
Немного теории про Oracle Instant Client:
Oracle Instant Client — это набор утилит и библиотек от Oracle, позволяющий запускать приложения, работающие с СУБД Oracle, без необходимости установки стандартного клиента. OCI, OCCI, Pro*C, ODBC, и JDBC приложения будут работать без каких-либо изменений не зависимо от того: установлен ли стандартный Oracle Client или Oracle Instant Client. Но при работе с последним будет использоваться значительно меньше места на жестком диске. SQL*Plus так же будет работать с Oracle Instant Client без каких-либо изменений или перекомпиляций.
Oracle Instant Client абсолютно бесплатен, доступен для множества платформ и архитектур, среди которых Mac OS X, Solaris, HP-UX, Linux и т.д.
Oracle Instant Client состоит из несколько пакетов:
- Basic. Все, что необходимо для запуска OCI, OCCI, JDBC-OCI приложений. (Обязательный)
- Basic Lite. Облегченная версия Basic. Сообщения об ошибках только на английском языке. Поддерживаются только Unicode, ASCII и Western European кодировки. (Обязательный)
- JDBC Supplement. Дополнительнаяя поддержка XA, интернационализации и RowSet-операций для JDBC.
- SQL*Plus. Дополнительные библиотеки и приложение для запуска SQL*Plus.
- ODBC Supplement. Дополнительные библиотеки для работы ODBC-приложений (не для всех платформ)
- SDK. Дополнительные заголовочные файлы и примеры мейкфайлов (makefile) для разработки Oracle-приложений с Instant Client.
- ODAC. Включает в себя: ODP.NET, Oracle Services для MTS, Oracle Providers для ASP.NET, Oracle Provider для OLE DB и OO4O.
- Tools. Включает в себя: Data Pump, SQL*Loader и Workload Replay Client.
Установка библиотек Oracle Instant Client
1. Установить конвертор RPM -> DEB (если его нет):
# apt-get install alien
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Следующие пакеты устанавливались автоматически и больше не требуются:
dbconfig-common dbconfig-mysql icc-profiles-free php php-auth-sasl php-bz2 php-curl php-gd php-gettext php-intl php-mail-mime php-mbstring php-mysql php-net-sieve php-net-smtp php-net-socket php-php-gettext php-phpseclib php-pspell php-tcpdf php-zip php7.3 php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-mbstring php7.3-mysql php7.3-pspell php7.3-zip roundcube-core roundcube-mysql
Для их удаления используйте «apt autoremove».
Предлагаемые пакеты: lintian
Следующие НОВЫЕ пакеты будут установлены:
Обновлено 0 пакетов, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 8 пакетов не обновлено.
Необходимо скачать 82,3 kB архивов.
После данной операции объём занятого дискового пространства возрастёт на 170 kB.
Пол:1 http://ftp.debian.org/debian buster/main amd64 alien all 8.95 [82,3 kB]
Получено 82,3 kB за 1с (160 kB/s)Выбор ранее не выбранного пакета alien.
(Чтение базы данных … на данный момент установлено 56432 файла и каталога.)
Подготовка к распаковке …/archives/alien_8.95_all.deb …
Распаковывается alien (8.95) …
Настраивается пакет alien (8.95) …
Обрабатываются триггеры для man-db (2.8.5-2) …
(Текст в первой строке, выделенный жирным, — это запускаемая команда в консоли. Остальной текст — лог выполнения команды)
2. Скачать с сайта ORACLE необходимые компоненты. Прямая ссылка на страницу с пакетами для Linux x86/64: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html Обычно достаточно пакетов Basic Package и SDK Package, также часто бывает нужен пакет Tools.
Внимание! Скачивать RPM-пакеты, а не ZIP-архивы.
3. Загрузить rpm-файлы на сервер во временную директорию, например, сюда: «/tmp/ora/»
4. Перейти в папку с пакетами:
# cd /tmp/ora/
5. Преобразовать каждый пакет из RPM в DEB:
root@new-server:/tmp/ora# alien oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm
root@new-server:/tmp/ora# alien oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm
root@new-server:/tmp/ora# alien oracle-instantclient19.6-tools-19.6.0.0.0-1.x86_64.rpm
6. Устанавить DEB-пакеты:
root@new-server:/tmp/ora# dpkg -i /tmp/ora/oracle-instantclient19.6-basic_19.6.0.0.0-2_amd64.deb
Выбор ранее не выбранного пакета oracle-instantclient19.6-basic.
(Чтение базы данных … на данный момент установлено 56455 файлов и каталогов.)
Подготовка к распаковке …/oracle-instantclient19.6-basic_19.6.0.0.0-2_amd64.deb …
Распаковывается oracle-instantclient19.6-basic (19.6.0.0.0-2) …
Настраивается пакет oracle-instantclient19.6-basic (19.6.0.0.0-2) …
Обрабатываются триггеры для libc-bin (2.28-10) …
root@new-server:/tmp/ora# dpkg -i /tmp/ora/oracle-instantclient19.6-devel_19.6.0.0.0-2_amd64.deb
Выбор ранее не выбранного пакета oracle-instantclient19.6-devel.
(Чтение базы данных … на данный момент установлено 56492 файла и каталога.)
Подготовка к распаковке …/oracle-instantclient19.6-devel_19.6.0.0.0-2_amd64.deb …
Распаковывается oracle-instantclient19.6-devel (19.6.0.0.0-2) …
Настраивается пакет oracle-instantclient19.6-devel (19.6.0.0.0-2) …
root@new-server:/tmp/ora# dpkg -i /tmp/ora/oracle-instantclient19.6-tools_19.6.0.0.0-2_amd64.deb
Выбор ранее не выбранного пакета oracle-instantclient19.6-tools.
(Чтение базы данных … на данный момент установлено 56544 файла и каталога.)
Подготовка к распаковке …/oracle-instantclient19.6-tools_19.6.0.0.0-2_amd64.deb …
Распаковывается oracle-instantclient19.6-tools (19.6.0.0.0-2) …
Настраивается пакет oracle-instantclient19.6-tools (19.6.0.0.0-2) …
7. Oracle Instant Client установлен. Интересно, где он поселился на сервере? Узнаем это с помощью команды whereis oracle:
# whereis oracle
oracle: /usr/lib/oracle /usr/include/oracle /usr/share/oracle
Можно проверить, так ли это на самом деле:
Все, первая часть выполнена.
II. Установка oci8 (PECL) для нативной версии php
8. Установить (если не был установлен ранее) php-pear:
# apt-get install php-pear
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Уже установлен пакет php-pear самой новой версии (1:1.10.6+submodules+notgz-1.1). php-pear помечен как установленный вручную.
Следующие пакеты устанавливались автоматически и больше не требуются: dbconfig-common dbconfig-mysql icc-profiles-free php php-auth-sasl php-bz2 php-curl php-gd php-gettext php-intl php-mail-mime php-mbstring php-mysql php-net-sieve php-net-smtp php-net-socket php-php-gettext php-phpseclib php-pspell php-tcpdf php-zip php7.3 php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-mbstring php7.3-mysql php7.3-pspell php7.3-zip roundcube-core roundcube-mysql
Для их удаления используйте «apt autoremove».
Обновлено 0 пакетов, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 5 пакетов не обновлено.
В моем случае php-pear уже был установлен изначально.
9. С сайта PECL http://pecl.php.net/package/oci8 скачать архив расширения oci8 для нужной версии PHP, например:
oci8 2.2.0 — для php7.х
oci8 2.0.12 — для php 5.2 – 5.6
oci8-1.4.10 — для php 4.3.9 – 5.1
10 . Загрузить архив расширения oci8 на сервер во временную папку, например в «/tmp/oci/»:
11. В пункте 8 мы устанавливали php-pear, нужно уточнить, куда он установился, чтобы правильно запускать команду на установку:
# whereis pear
pear: /usr/bin/pear /opt/php56/bin/pear /opt/php71/bin/pear /opt/php54/bin/pear /opt/php74/bin/pear /usr/share/man/man1/pear.1.gz
Команда «где пир» показала, где прописаны все пиры:
/usr/bin/pear – нативный пир (php 7.3)
/opt/php74/bin/pear – пир для альтернативной версии php7.4
/opt/php54/bin/pear – пир для альтернативной версии php5.4
и др. по аналогии.
12. Установить расширение oci8 с помощью pear. Для нативной версии php команда будет такой:
/usr/bin/pear install /tmp/oci/oci8-2.2.0.tgz
Запускаем в консоли:
# /usr/bin/pear install /tmp/oci/oci8-2.2.0.tgz
11 source files, building
Configuring for: PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
Please provide the path to the ORACLE_HOME directory. Use ‘instantclient,/path/to/instant/client/lib’ if you’re compiling with Oracle Instant Client [autodetect] :
[нажал Enter]
building in /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0
running: /tmp/pear/temp/oci8/configure —with-php-config=/usr/bin/php-config —with-oci8
checking for grep that handles long lines and -e. /usr/bin/grep
checking for egrep. /usr/bin/grep -E
checking for a sed that does not truncate output. /usr/bin/sed
checking for cc. cc
checking whether the C compiler works. yes
checking for C compiler default output file name. a.out
checking for suffix of executables.
checking whether we are cross compiling. no
checking for suffix of object files. o
checking whether we are using the GNU C compiler. yes
checking whether cc accepts -g. yes
checking for cc option to accept ISO C89. none needed
checking how to run the C preprocessor. cc -E
checking for icc. no
checking for suncc. no
checking whether cc understands -c and -o together. yes
checking for system library directory. lib
checking if compiler supports -R. no
checking if compiler supports -Wl,-rpath. yes
checking build system type. x86_64-pc-linux-gnu
checking host system type. x86_64-pc-linux-gnu
checking target system type. x86_64-pc-linux-gnu
checking for PHP prefix. /usr
checking for PHP includes. -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib
checking for PHP extension directory. /usr/lib/php/20180731
checking for PHP installed headers prefix. /usr/include/php/20180731
checking if debug is enabled. no
checking if zts is enabled. no
checking for re2c. no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk. gawk
checking for Oracle Database OCI8 support. yes, shared
checking PHP version. 7.3.19, ok
checking OCI8 DTrace support. no
checking size of long int. 8
checking checking if we’re on a 64-bit platform. yes
configure: WARNING: OCI8 extension: ORACLE_HOME is not set, looking for default Oracle Instant Client instead
checking Oracle Instant Client directory. /usr/lib/oracle/19.6/client64/lib
checking Oracle Instant Client SDK header directory. /usr/include/oracle/19.6/client64
checking Oracle Instant Client library version compatibility. 19.1
checking how to print strings. printf
checking for a sed that does not truncate output. (cached) /usr/bin/sed
checking for fgrep. /usr/bin/grep -F
checking for ld used by cc. /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld. yes
checking for BSD- or MS-compatible name lister (nm). /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface. BSD nm
checking whether ln -s works. yes
checking the maximum length of command line arguments. 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format. func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format. func_convert_file_noop
checking for /usr/bin/ld option to reload object files. -r
checking for objdump. objdump
checking how to recognize dependent libraries. pass_all
checking for dlltool. no
checking how to associate runtime and link libraries. printf %s\n
checking for ar. ar
checking for archiver @FILE support. @
checking for strip. strip
checking for ranlib. ranlib
checking for gawk. (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object. ok
checking for sysroot. no
checking for a working dd. /usr/bin/dd
checking how to truncate binary pipes. /usr/bin/dd bs=4096 count=1
checking for mt. mt
checking if mt is a manifest tool. no
checking for dlfcn.h. yes
checking for objdir. .libs
checking if cc supports -fno-rtti -fno-exceptions. no
checking for cc option to produce PIC. -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works. yes
checking if cc static flag -static works. yes
checking if cc supports -c -o file.o. yes
checking if cc supports -c -o file.o. (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries. yes
checking whether -lc should be explicitly linked in. no
checking dynamic linker characteristics. GNU/Linux ld.so
checking how to hardcode library paths into programs. immediate
checking whether stripping libraries is possible. yes
checking if libtool supports shared libraries. yes
checking whether to build shared libraries. yes
checking whether to build static libraries. no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=compile cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8.c -o oci8.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8.c -fPIC -DPIC -o .libs/oci8.o /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=compile cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_lob.c -o oci8_lob.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_lob.c -fPIC -DPIC -o .libs/oci8_lob.o /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=compile cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_statement.c -o oci8_statement.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_statement.c -fPIC -DPIC -o .libs/oci8_statement.o /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=compile cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_collection.c -o oci8_collection.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_collection.c -fPIC -DPIC -o .libs/oci8_collection.o /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=compile cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_interface.c -o oci8_interface.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_interface.c -fPIC -DPIC -o .libs/oci8_interface.o /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=compile cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_failover.c -o oci8_failover.lo
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/oci8/oci8_failover.c -fPIC -DPIC -o .libs/oci8_failover.o /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=link cc -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/usr/include/oracle/19.6/client64 -DHAVE_CONFIG_H -g -O2 -o oci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/modules oci8.lo oci8_lob.lo oci8_statement.lo oci8_collection.lo oci8_interface.lo oci8_failover.lo -Wl,-rpath,/usr/lib/oracle/19.6/client64/lib -L/usr/lib/oracle/19.6/client64/lib -lclntsh
libtool: link: cc -shared -fPIC -DPIC .libs/oci8.o .libs/oci8_lob.o .libs/oci8_statement.o .libs/oci8_collection.o .libs/oci8_interface.o .libs/oci8_failover.o -L/usr/lib/oracle/19.6/client64/lib -lclntsh -g -O2 -Wl,-rpath -Wl,/usr/lib/oracle/19.6/client64/lib -Wl,-soname -Wl,oci8.so -o .libs/oci8.so
libtool: link: ( cd «.libs» && rm -f «oci8.la» && ln -s «../oci8.la» «oci8.la» ) /bin/bash /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/libtool —mode=install cp ./oci8.la /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/modules
libtool: install: cp ./.libs/oci8.so /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/modules/oci8.so
libtool: install: cp ./.libs/oci8.lai /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/modules/oci8.la
libtool: finish: PATH=»/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin» ldconfig -n /tmp/pear/temp/pear-build-rootWzdymg/oci8-2.2.0/modules
Libraries have been installed in:
If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the ‘-LLIBDIR’ flag during linking and do at least one of the following:
— add LIBDIR to the ‘LD_LIBRARY_PATH’ environment variable during execution
— add LIBDIR to the ‘LD_RUN_PATH’ environment variable during linking
— use the ‘-Wl,-rpath -Wl,LIBDIR’ linker flag
— have your system administrator add LIBDIR to ‘/etc/ld.so.conf’
See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages.
Don’t forget to run ‘make test’.
running: make INSTALL_ROOT=»/tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0″ install
Installing shared extensions: /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0/usr/lib/php/20180731/
running: find «/tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0» | xargs ls -dils
18352266 4 drwxr-xr-x 3 root root 4096 июл 13 14:11 /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0
18352297 4 drwxr-xr-x 3 root root 4096 июл 13 14:11 /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0/usr
18352298 4 drwxr-xr-x 3 root root 4096 июл 13 14:11 /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0/usr/lib
18352299 4 drwxr-xr-x 3 root root 4096 июл 13 14:11 /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0/usr/lib/php
18352300 4 drwxr-xr-x 2 root root 4096 июл 13 14:11 /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0/usr/lib/php/20180731
18352295 896 -rwxr-xr-x 1 root root 914344 июл 13 14:11 /tmp/pear/temp/pear-build-rootWzdymg/install-oci8-2.2.0/usr/lib/php/20180731/oci8.so
Build process completed successfully
install ok: channel://pecl.php.net/oci8-2.2.0
configuration option «php_ini» is not set to php.ini location
You should add «extension=oci8.so» to php.ini
Расширение oci8.so для нативной версии php (php7.3) было успешно установлено в папку /usr/lib/php/20180731/
Создавать INI-файл для нативной версии не требуется.
13. Активировать расширение oci8 для нативной версии – php7.3 в панели управления ISP Manager:
14. Проверить работу расширения oci8 с помощью команды phpinfo():
или с помощью простого php-скрипта:
throw new Exception(«PHP extention oci8 not loaded!»);
echo «PHP extention oci8 loaded!».$eol;
Можно также добавить в php-скрипт подключение к реальной БД ORACLE и получить из нее записи.
III. Установка oci8 (PECL) для альтернативной версии php
Некоторые проекты могут требовать для работы конкретную версию php (обычно это какая-нибудь старая версия), поэтому установленного расширения oci8 только для нативной версии может быть не достаточно.
15. Аналогично пункту 9 — сайта PECL http://pecl.php.net/package/oci8 скачать архив расширения oci8 для нужной версии PHP:
oci8 2.2.0 — для php7.х
oci8 2.0.12 — для php 5.2 – 5.6
oci8-1.4.10 — для php 4.3.9 – 5.1
16 . Аналогично пункту 10 — загрузить архив расширения oci8 на сервер во временную папку, например в «/tmp/oci/»:
17. Установить расширение oci8 с помощью pear (где pear живет, мы узнали в пункте 11).
Для альтернативной версии php 7.4 команда будет такой:
/opt/php74/bin/pear install /tmp/oci/oci8-2.2.0.tgz
Для альтернативной версии php 5.4 команда будет такой:
/opt/php54/bin/pear install /tmp/oci/oci8-2.0.12.tgz
Полные логи установки не вставил, они, в принципе, похожи на установку нативной версии.
Концовка лога установки oci8 для php7.4:
Build process completed successfully
install ok: channel://pecl.php.net/oci8-2.2.0
configuration option «php_ini» is not set to php.ini location
You should add «extension=oci8.so» to php.ini
В результате видим, что расширение oci8.so для альтернативной версии php (7.4) было установлено в папку /opt/php74/lib/php/modules/
18. В папке /opt/php74/etc/mods-available/ создать файл oci8.ini с содержимым: extension= oci8.so
Гораздо проще и быстрее это можно также сделать с помощью команды в консоли.
Для php7.4:
# echo extension=oci8.so >> /opt/php74/etc/mods-available/oci8.ini
Для php5.4:
# echo extension=oci8.so >> /opt/php54/etc/mods-available/oci8.ini
19. Активировать расширение oci8 для требуемой альтернативной версии php в панели управления ISP Manager:
20. Проверить работу расширения (аналогично п. 14).
Источник