This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,899 Users
  • 2,269,649 Discussions
  • 7,916,821 Comments

Discussions

Unable to connect to oracle with "bool(false)" message

696154
696154 Member Posts: 4
edited Aug 12, 2011 3:17PM in PHP
Hi,
my php unable to connect to database with message "bool(false)"

connect string :
$c = oci_connect("userid", "pwd", "db");
if (!$c)
{echo "unable to connect: ". var_dump(oci_error());
die();}

os : Linux Centos 5.2
php version : php 5.1.6
apache version : 2.2.3
Oracle version : 10g Rel.2
Oracle + apache + php on the same machine.

i hv followed instruction from php.net/manuel/en/oci8.installation.php and my oci8 environment was set as my oracle bash_profile environment but still can't get connected.

is there any post similiar with this ?
any help would be appreciated.
tks.

Edited by: HeLmi on Aug 3, 2011 2:40 PM

Answers

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,657 Employee
    The page you referenced says "On Red Hat Linux and variants, export variables at the end of /etc/sysconfig/httpd". Setting variables in your bash start scripts won't affect httpd.
  • 696154
    696154 Member Posts: 4
    i meant i hv set my /etc/sysconfig/httpd variables as the same as my bash script, like ORACLE_HOME, ORACLE_SID, TNS_ADMIN and i can view that variables on the environment section with phpinfo().
    and i hv set extension=oci8.so in /etc/php.ini

    i hv followed instruction from "underground php and oracle manual" but i just can't found what did i missed in my configuration ?
  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,657 Employee
    By now I expect you'll have found the oci_error() function and have got useful information about what exactly is failing. Perhaps you even solved the problem yourself?
  • 696154
    696154 Member Posts: 4
    thanks fyi.

    my connect string :
    $c = oci_connect("userid", "pwd", "db");
    if (!$c)
    {echo "unable to connect: ". var_dump(oci_error());
    die();}

    my oci_error() not show any error message.
    error in my browser : "bool(false). unable to connect: "
    just that, with no other information.

    maybe couse my php version is default php from centos 5.2, do i need to upgrade my php ?
    or just missing configuration ?
  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,657 Employee
    Did you ever sort this out? Is there environment information that would aid us in tracking down the issue?
This discussion has been closed.