PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : PHP: Crash bei DB-Verbindung mit pdo_oci



blabub
25.01.08, 16:08
Hi there,

First my problem is, that when I try to start a db connection over pdo_oci, php will crash.
More information later in the post.


My system:

Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
Apache/2.2.6 (Unix)
PHP Version 5.2.5
Oracle Instant client 10.2.0

I've build PHP with following flags:



'./configure' '--with-apxs2=/CHBS/apps_local/apps/apache2/bin/apxs' '--with-mysql=/CHBS/apps_local/apps/mysql' '--prefix=/CHBS/apps_local/apps/php' '--with-config-file-path=/CHBS/apps_local/apps/php' '--enable-force-cgi-redirect' '--disable-cgi' '--with-zlib' '--with-gettext' '--with-gdbm' '--exec-prefix=/CHBS/apps_local/apps/php' '--with-zlib' '--with-oci8=instantclient,/u01/home/oracle/product/10.2.0/CL'


PHP compiled without problems.


My env-vars:

ORACLE_HOME=/u01/home/oracle/product/10.2.0/CL
TNS_ADMIN=/u01/home/oracle/local
ORACLE_SID=orcl
LD_LIBRARY_PATH=/u01/home/oracle/product/10.2.0/CL/lib
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1


The PHP-File:



<?php

$pdo = new PDO( "oci:host=mydb;dbname=mydb", "myuser", "mypassword", array( PDO::ATTR_PERSISTENT => true ) );

echo "Connection done";

?>


This file will work on gentoo.


php bash output:



bash-3.00# php -a test.php
Interactive mode enabled

Connection done



If I try to call the file over the web, the page will not load. Get this message:



[code=SERVER_RESPONSE_CLOSE] The server closed the connection while reading the response. Contact your system administrator.


There is no information logged in the apache error log.


Now I don't know where the problem can be.



Some last information:

php.ini


extension=pdo_oci.so


phpinfo()


oci8:
Version 1.2.4
Revision $Revision: 1.269.2.16.2.38 $
Oracle Instant Client Version 10.2
Temporary Lob support enabled
Collections support enabled

PDO:
PDO drivers sqlite2, sqlite, oci
PDO Driver for OCI 8 and later enabled

other:
libxml2 Version 2.6.16
ZLib Support enabled
HOSTTYPE i386-linux
TNS_ADMIN /u01/home/oracle/local
C_INCLUDE_PATH /u01/home/oracle/product/10.2.0/CL/include
ORACLE_HOME /u01/home/oracle/product/10.2.0/CL
NLS_LANG AMERICAN_AMERICA.WE8ISO8859P1


apache configuration:


./configure --prefix=/CHBS/apps_local/apps/apache2 --enable-so--enable-cgi--enable-info--enable-rewrite--enable-speling--enable-usertrack--enable-deflate --enable-ssl--enable-mime-magic --exec-prefix=/CHBS/apps_local/apps/apache2



So that all information I have.


Thanks a lot for help

MiGo
26.01.08, 10:36
There is no information logged in the apache error log.
The problem seems to be database sided.
Are you sure the user is allowed to log into the database from the webserver?
Anything in the database server's logs?

blabub
28.01.08, 11:31
Hi,

I'm sure it's not the db the cause this problem.


A short overview about the situation:

- I have two Servers one with redhat and the other one with gentoo.
- Same apache/php/instantclient on both


Now this script posted before, works fine under gentoo. On redhat it will crash.
I checked it with gdm, but I don't understand the problem. I tried two versions of the oracle instantclient.

GDM-Log:


#0 0x013730fa in gsluinit () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#1 0x01373920 in gsluizgcGetContext () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#2 0x01361171 in gslccx_Getgsluctx () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#3 0x013440c7 in ora_create_discov_hdl () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#4 0x0148a458 in nnflgetnlpactx () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#5 0x0148aab1 in nnflgcp () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#6 0x01485daf in nnflobc () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#7 0x014843a6 in nnfln2x () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#8 0x01482b76 in nnflboot () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#9 0x013a362c in nnfgrne () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#10 0x014ace6f in nlolgobj () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#11 0x013a1bc2 in nnfun2a () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#12 0x013a1834 in nnfsn2a () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#13 0x013e3b20 in niqname () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#14 0x0130e0a9 in kwfnran () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#15 0x012d6ca0 in kwfcinit () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#16 0x01137361 in kpuatch () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#17 0x012545bd in OCIServerAttach () from /server_files/apps/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
#18 0x00ad533f in pdo_oci_handle_factory (dbh=0x92ea1b8, driver_options=0xb7e938bc)
at /server_files/downloads/sources/php-5.2.5/ext/pdo_oci/oci_driver.c:574
#19 0x00ac8dff in zim_PDO_dbh_constructor (ht=4, return_value=0xb7e938f8, return_value_ptr=0x0, this_ptr=0xb7e95dac, return_value_used=0)
at /server_files/downloads/sources/php-5.2.5/ext/pdo/pdo_dbh.c:372
#20 0x00c8c9df in zend_do_fcall_common_helper_SPEC (execute_data=0xbff24c90) at /server_files/downloads/sources/php-5.2.5/Zend/zend_vm_execute.h:200
#21 0x00c8d3f5 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbff24c90) at /server_files/downloads/sources/php-5.2.5/Zend/zend_vm_execute.h:322
#22 0x00c8c5f4 in execute (op_array=0xb7e920f0) at /server_files/downloads/sources/php-5.2.5/Zend/zend_vm_execute.h:92
#23 0x00c6cd16 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /server_files/downloads/sources/php-5.2.5/Zend/zend.c:1134
#24 0x00c268ba in php_execute_script (primary_file=0xbff26f60) at /server_files/downloads/sources/php-5.2.5/main/main.c:2004
#25 0x00cd286f in php_handler (r=0x92e60d8) at /server_files/downloads/sources/php-5.2.5/sapi/apache2handler/sapi_apache2.c:631
#26 0x08071b02 in ap_run_handler (r=0x92e60d8) at config.c:157
#27 0x08071ecd in ap_invoke_handler (r=0x92e60d8) at config.c:372
#28 0x08086231 in ap_process_request (r=0x92e60d8) at http_request.c:258
#29 0x08083ec5 in ap_process_http_connection (c=0x92e2260) at http_core.c:184
#30 0x0807730a in ap_run_process_connection (c=0x92e2260) at connection.c:43
#31 0x08096b03 in child_main (child_num_arg=Variable "child_num_arg" is not available.
) at prefork.c:640
#32 0x08096ccc in make_child (s=0x2, slot=0) at prefork.c:680
#33 0x0809721f in ap_mpm_run (_pconf=0x91440a8, plog=0x91821a0, s=0x9148c80) at prefork.c:956
#34 0x08061fac in main (argc=2, argv=0xbff274c4) at main.c:730