Hi,

Phpinfo() function shows that oci8 and oracle libraries had been installed with PHP.

However, a portion of my code like:
<?php
print "<HTML><PRE>";
$db = "bmcs";
$c1 = ocilogon("scott","scott1i",$db);
// $c2 = ocilogon("scott","scott1i",$db);

function create_table($conn)
{ $stmt = ociparse($conn,"create table scott.hallo (test varchar2(64))");
ociexecute($stmt);
echo $conn." created table\n\n";
}

It gives an error
Warning: _oci_open_server: Error while trying to retrieve text for error ORA-12154
in /usr/local/apache/htdocs/see1.php on line 4

Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in /usr/local/apache/htdocs/see1.php on line 8

Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in /usr/local/apache/htdocs/see1.php on line 9
created table

Any idea please? I used to be able to run the same code (without any modification successfully) But I reinstall my php from ver 4.0 to 4.2.3 now, it can't work.

Please help.
Thank you very much

    Hi,

    first, look at your varaible names:

    $c1 = ocilogon("scott","scott1i",$db); 
    
    function create_table($conn)  ...
    

    you should use $conn as a variable for the ocilogon or $c1 in your function. 😉

    maybe you also forgot to enable the extension in your php.ini file.
    check if the extension is enabled.

    and, what webserver do you use?

    the apache server normally shows an error if an extension could not be loaded.

      hi Thanks for your reply.

      I am using apache 1.3.27 running on SUN 2.6, php 4.2.3.

      Hence there's no dll need to be loaded.

      When I enable dll in my php.ini for windows platform with the same code it is able to run successfully.

      Anyway, what happen yesterday for my unix platform, I logout the user who has privilege to start apache and relogin then I restarted my apache, thereafter the script is able to work.

      Hurray, but it just seems so strange to me.

      Thanks.

        Write a Reply...