Oracle 11.1.0.7 and WAMP oci_connect failure

Asked
Active3 hr before
Viewed126 times

8 Answers

oracle
90%

Looking at your configuration, you have both the Oracle Client and the Oracle Instant Client installed:,Specifically alter your path to ensure that the Instant Client libraries are found first - making sure, of course, that you are impacting the effective path used by PHP, not just a PATH variable in a separate context...,I've never actually got PHP to work correctly with the Instant Client - I gave up and installed the full client - so my personal recommendation is option 1, but if that's not practical in your environment, work with the PATH first., At least, the syntax looks fine. What are your PHP and Instant Client versions? – Álvaro González Feb 1 '12 at 16:25

Oracle Run - time Client Library Version 10.2 .0 .1 .0
Oracle Instant Client Version 11.2
88%

oci_connect — Connect to an Oracle database, Returns a connection identifier or false on error. ,(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0),oci_pconnect() - Connect to an Oracle database using a persistent connection

load more v
72%

Я использую последнюю 32-битную версию от WAMP (я снова взял ее сегодня, просто чтобы проверить) Машина БД также 32-битная, а не локальная , Я работаю над этим проектом, где мне нужно подключиться к базе данных Oracle. Я использую последнюю версию WAMP 2.2, а также активировал все расширения, связанные с Oracle в PHP расширениях. Я... , До сих пор я успешно использую сервер WAMP с oracle в течение одного года,но, к сожалению, он перестал работать и отображает ошибку, подобную этой фатальной ошибке: вызов неопределенной функции... , Я работаю над этим проектом, где мне нужно подключиться к базе данных Oracle. Я использую последнюю версию WAMP 2.2, а также активировал все расширения, связанные с Oracle в PHP расширениях. Я использовал следующий код для подключения к базе данных Oracle. <?php $dbHost = 192.168.0.205;...

вот мои попытки подключения к базе данных, каждый раз я получал одну и ту же ошибку :

    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = some.ip.addr)(PORT = 1521)))(CONNECT_DATA=(SID=somesid)))";
    //$link = oci_connect('sqlmap', 'sqlmap', 'some.ip.addr') OR die('oci_connect' . print_r(oci_error()));
    //$link = oci_connect('sqlmap', 'sqlmap', $db) OR die('oci_connect error' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', 'some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    $link = oci_connect('sqlmap', 'sqlmap', '//some.ip.addr/somesid');

    Warning: oci_connect()[function.oci - connect]: ORA - 24315: illegal attribute type in

       Array([code] => 24315[message] => ORA - 24315: illegal attribute type[offset] => 0[sqltext] => ) oci_connect1

Еще немного информации о OCI

OCI8 Support enabled
Version 1.4 .7
Revision $Revision: 321634 $
Active Persistent Connections 0
Active Connections 0
Oracle Run - time Client Library Version 10.2 .0 .1 .0
Oracle Instant Client Version 11.2
Temporary Lob support enabled
Collections support enabled

Directive Local Value Master Value
oci8.connection_class no value no value
oci8.default_prefetch 100 100
oci8.events Off Off
oci8.max_persistent - 1 - 1
oci8.old_oci_close_semantics Off Off
oci8.persistent_timeout - 1 - 1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20

Apache Version:
   2.2 .21
PHP Version:
   5.3 .9
load more v
65%

Regístrese para continuar usando todas las funciones de Techfeed, Estoy tratando de configurar una conexión simple entre mi servidor WAMP local y algunos Oracle 11.1.0.7 que tengo. Aparentemente, PHP tiene todo tipo de soluciones y situaciones mágicas donde no se inicia.,El actuador Spring Boot / punto final de estado no muestra información de la base de datos o del sistema de archivos,Awk para reemplazar comillas simples

aquí están mis intentos de conectarme a la base de datos, cada vez que recibo el mismo error:

    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = some.ip.addr)(PORT = 1521)))(CONNECT_DATA=(SID=somesid)))";
    //$link = oci_connect('sqlmap', 'sqlmap', 'some.ip.addr') OR die('oci_connect' . print_r(oci_error()));
    //$link = oci_connect('sqlmap', 'sqlmap', $db) OR die('oci_connect error' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', 'some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    $link = oci_connect('sqlmap', 'sqlmap', '//some.ip.addr/somesid');

    Warning: oci_connect()[function.oci - connect]: ORA - 24315: illegal attribute type in

       Array([code] => 24315[message] => ORA - 24315: illegal attribute type[offset] => 0[sqltext] => ) oci_connect1
load more v
75%

И, наконец, откройте Wamp и включите расширение php_oci8_11g

вот мои попытки подключения к базе данных, каждый раз, когда я получал ту же ошибку:

    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = some.ip.addr)(PORT = 1521)))(CONNECT_DATA=(SID=somesid)))";
    //$link = oci_connect('sqlmap', 'sqlmap', 'some.ip.addr') OR die('oci_connect' . print_r(oci_error()));
    //$link = oci_connect('sqlmap', 'sqlmap', $db) OR die('oci_connect error' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', 'some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    $link = oci_connect('sqlmap', 'sqlmap', '//some.ip.addr/somesid');

    Warning: oci_connect()[function.oci - connect]: ORA - 24315: illegal attribute type in

       Array([code] => 24315[message] => ORA - 24315: illegal attribute type[offset] => 0[sqltext] => ) oci_connect1

Дополнительная информация о OCI

OCI8 Support enabled
Version 1.4 .7
Revision $Revision: 321634 $
Active Persistent Connections 0
Active Connections 0
Oracle Run - time Client Library Version 10.2 .0 .1 .0
Oracle Instant Client Version 11.2
Temporary Lob support enabled
Collections support enabled

Directive Local Value Master Value
oci8.connection_class no value no value
oci8.default_prefetch 100 100
oci8.events Off Off
oci8.max_persistent - 1 - 1
oci8.old_oci_close_semantics Off Off
oci8.persistent_timeout - 1 - 1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20

Apache Version:
   2.2 .21
PHP Version:
   5.3 .9
load more v
40%

Cài đặt đầy đủ Oracle 11g Client,Nhìn vào cấu hình của bạn, bạn đã cài đặt cả Oracle Client và Oracle Instant Client:,oracle-call-interface,sao chép thư mục đã giải nén này vào C: \ Windows \ SysWOW64 \ Instantclient_11_1

đây là những nỗ lực của tôi trong việc kết nối với cơ sở dữ liệu, lần nào tôi cũng gặp lỗi tương tự:

    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = some.ip.addr)(PORT = 1521)))(CONNECT_DATA=(SID=somesid)))";
    //$link = oci_connect('sqlmap', 'sqlmap', 'some.ip.addr') OR die('oci_connect' . print_r(oci_error()));
    //$link = oci_connect('sqlmap', 'sqlmap', $db) OR die('oci_connect error' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', 'some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    $link = oci_connect('sqlmap', 'sqlmap', '//some.ip.addr/somesid');

    Warning: oci_connect()[function.oci - connect]: ORA - 24315: illegal attribute type in

       Array([code] => 24315[message] => ORA - 24315: illegal attribute type[offset] => 0[sqltext] => ) oci_connect1

Một số thông tin khác về OCI

OCI8 Support enabled
Version 1.4 .7
Revision $Revision: 321634 $
Active Persistent Connections 0
Active Connections 0
Oracle Run - time Client Library Version 10.2 .0 .1 .0
Oracle Instant Client Version 11.2
Temporary Lob support enabled
Collections support enabled

Directive Local Value Master Value
oci8.connection_class no value no value
oci8.default_prefetch 100 100
oci8.events Off Off
oci8.max_persistent - 1 - 1
oci8.old_oci_close_semantics Off Off
oci8.persistent_timeout - 1 - 1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20

Apache Version:
   2.2 .21
PHP Version:
   5.3 .9
load more v
22%

Instalar todo o Oracle 11g Cliente


    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = some.ip.addr)(PORT = 1521)))(CONNECT_DATA=(SID=somesid)))";
    //$link = oci_connect('sqlmap', 'sqlmap', 'some.ip.addr') OR die('oci_connect' . print_r(oci_error()));
    //$link = oci_connect('sqlmap', 'sqlmap', $db) OR die('oci_connect error' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', 'some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    //$link = oci_connect('sqlmap','sqlmap', '//some.ip.addr/somesid') or die('<= oci_connect ' . print_r(oci_error()));
    $link = oci_connect('sqlmap', 'sqlmap', '//some.ip.addr/somesid');

    Warning: oci_connect()[function.oci - connect]: ORA - 24315: illegal attribute type in

       Array([code] => 24315[message] => ORA - 24315: illegal attribute type[offset] => 0[sqltext] => ) oci_connect1
load more v
60%

PHP Warning: PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/oci8.so (Error loading shared library libresolv.so.2: No such file or directory (needed by /usr/local/instantclient/libclntsh.so.18.1)), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/oci8.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20170718/oci8.so.so: No such file or directory)) in Unknown on line 0,These are the packages I am installing on Docker container create:,When doing the php -v I get the following error:,I have Alpine v3.7 Docker image and to put things short, I am installing OCI8 extension for PHP.

These are the packages I am installing on Docker container create:

RUN apk add--update\
autoconf gcc g++make libaio - dev libnsl gettext - dev automake libtool libc6 - compat;
load more v

Other "oracle-undefined" queries related to "Oracle 11.1.0.7 and WAMP oci_connect failure"