php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45257 Segmentation fault when connecting to oracle database using oci8
Submitted: 2008-06-13 09:10 UTC Modified: 2008-06-16 02:32 UTC
From: buddhikasg at millnniumit dot com Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.6 OS: Sun Solaris 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: buddhikasg at millnniumit dot com
New email:
PHP Version: OS:

 

 [2008-06-13 09:10 UTC] buddhikasg at millnniumit dot com
Description:
------------
Hi,

I'm new to PHP/OCI8 and i managed to install php with oci8 support. But where i try to connect to database php terminated giving a segmentation falut. 

Apache log extract as below:
[Sat Jun 14 08:49:50 2008] [notice] child pid 28095 exit signal Segmentation Fault (11)

Core file contains:
#0  0x00000000 in ?? ()
#1  0xfe1961c8 in nnfgast () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#2  0xfe196a3f in nnfgrne () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#3  0xfe20b30d in nlolgobj () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#4  0xfe1951ab in nnfun2a () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#5  0xfe194e9e in nnfsn2a () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#6  0xfe183f97 in niqname () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#7  0xfe0cfd54 in kwfnran () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#8  0xfe0a7b33 in kwfcinit () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#9  0xfdf26f04 in kpuatch () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#10 0xfdfe6f06 in OCIServerAttach () from /u01/ora10g2/product/10.2.0/lib32/libclntsh.so.10.1
#11 0xfea1776f in php_oci_do_connect_ex (username=0x83ebbb8 "user", username_len=7, password=0x83eb088 "xxxx", password_len=7, new_password=0x0, new_password_len=0, dbname=0x83eb0b0 "sa_ft8", 
    dbname_len=6, charset=0x0, session_mode=0, persistent=0, exclusive=0) at /mri/php-5.2.6/ext/oci8/oci8.c:1261
#12 0xfea18997 in php_oci_do_connect (ht=3, return_value=0x83eb0c0, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, persistent=0, exclusive=0) at /mri/php-5.2.6/ext/oci8/oci8.c:983
#13 0xfea236d7 in zif_oci_connect (ht=3, return_value=0x83eb0c0, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /mri/php-5.2.6/ext/oci8/oci8_interface.c:1554
#14 0x08276f65 in zend_do_fcall_common_helper_SPEC (execute_data=0x80474a0) at /mri/php-5.2.6/Zend/zend_vm_execute.h:200
#15 0x08276539 in execute (op_array=0x83ea4b0) at /mri/php-5.2.6/Zend/zend_vm_execute.h:92
#16 0x08259d08 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /mri/php-5.2.6/Zend/zend.c:1134
#17 0x0821b3ce in php_execute_script (primary_file=0x8047c54) at /mri/php-5.2.6/main/main.c:2005
#18 0x082ed83f in main (argc=3, argv=0x8047cd8) at /mri/php-5.2.6/sapi/cli/php_cli.c:1140

Reproduce code:
---------------
sample php file:

<?php
 
// Set Oracle Environment
PutEnv("ORACLE_SID=mysid");
PutEnv("ORACLE_HOME=/u01/ora10g2/product/10.2.0");
PutEnv("TNS_ADMIN=/u01/ora10g2/product/10.2.0/network/admin");
PutEnv("LD_LIBRARY_PATH=/u01/ora10g2/product/10.2.0/lib32");
 
if ($conn = oci_connect("user", "xxxx", "mysid")) {
echo "Ok";
oci_close($conn);
} else {
$errmsg = oci_error();
echo "Not connected";
}
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-13 16:17 UTC] sixd@php.net
A golden rule is do not set environment variables like LD_LIBRARY_PATH or ORACLE_HOME in PHP scripts. These variables need to be set in the environment that starts the webserver. This may or may not be your problem - not enough supporting or investigative information is given for me to guess. Please follow up in a Support forum (e.g. the php-db mail list, or Oracle's OTN forum) before reopening this bug.
 [2008-06-16 02:32 UTC] buddhikasg at millnniumit dot com
FYI, environment variables are already in the Apache users env. variables list.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 08:01:32 2025 UTC