Professional Web Applications Themes

PHP OCI8 - PHP Development

Hi all, We had to switch to windows 2003 server with IIS and now i've got a problem with the OCI8 :(( Big time! I know php works. I have tested this. I know the oracle\bin is in the path. I checked. At first I just made the extension active and then PHP stopped. Pages wouldn't load and the IIS had to be restarted. Eventhouh the oracle\bin was in the path I took out the oci.dll because I know oci8.dll looks for it and put it in the windows dir. Now PHP would work again and the phpinfo() tells me ...

  1. #1

    Default PHP OCI8

    Hi all,

    We had to switch to windows 2003 server with IIS and now i've got a
    problem with the OCI8 :(( Big time!

    I know php works. I have tested this.
    I know the oracle\bin is in the path. I checked.

    At first I just made the extension active and then PHP stopped. Pages
    wouldn't load and the IIS had to be restarted.

    Eventhouh the oracle\bin was in the path I took out the oci.dll
    because I know oci8.dll looks for it and put it in the windows dir.
    Now PHP would work again and the phpinfo() tells me the OCI extenion
    has been loaded.

    Now I really want to use oracle and the first thing I encounter is:

    Warning: ocilogon(): _oci_open_server: SĒ in F:\web\exp\testORA.php on
    line 10

    No clear error message just some garbage. In this case SĒ.

    I made the complete oracle directory read and execute, at first for
    the IUSR user and later on for Everyone but that din't help. I know I
    must be missing something and that's why I asking you.

    Any suggestions?

    TIA

    Roger who lost a week up to now :(

    PIII450@HOME.NL Guest

  2. #2

    Default Re: PHP OCI8

    On Sat, 07 Feb 2004 17:41:07 +0000, Andy Hassall <co.uk>
    wrote:
     
    >
    > Don't multipost - see reply in comp.lang.php.[/ref]

    I posted them at about the same time so there wasn't an asnwer yet.
    You seem to know so tell me.... how should I ask the same question in
    more than 1 group?

    PIII450@HOME.NL Guest

  3. #3

    Default Re: PHP OCI8

    On Sat, 07 Feb 2004 12:59:11 +0000, Andy Hassall <co.uk>
    wrote:
     
    >
    > Stop - and put it back where it was. Once you start fiddling with an Oracle
    >install like this, Bad Things Happen.

    >
    > Hm, not a good sign.

    >
    > What version of Oracle and PHP?
    >
    > As for the permissions, as well as Read and Execute I've got List Folder
    >Contents as well (makes sense since it might want to look for localised message
    >files?)
    >
    > Do you have more than one Oracle home on the system?[/ref]

    I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
    first time I did give them the list right as well. So maybe this
    little extra info can help.

    Thanks.

    Roger
    PIII450@HOME.NL Guest

  4. #4

    Default Re: PHP OCI8

    On Fri, 06 Feb 2004 20:13:13 +0100, "NL"
    <NL> wrote:
     
    >>
    >> Stop - and put it back where it was. Once you start fiddling with an Oracle
    >>install like this, Bad Things Happen.
    >> 
    >>
    >> Hm, not a good sign.
    >> 
    >>
    >> What version of Oracle and PHP?
    >>
    >> As for the permissions, as well as Read and Execute I've got List Folder
    >>Contents as well (makes sense since it might want to look for localised message
    >>files?)
    >>
    >> Do you have more than one Oracle home on the system?[/ref]
    >[/ref]
    I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
    first time I did give them the list right as well. So maybe this
    little extra info can help.

    Thanks.

    Roger

    And only 1 home :)
    PIII450@HOME.NL Guest

  5. #5

    Default Re: PHP OCI8

    On Fri, 06 Feb 2004 12:49:06 +0100, "NL" <NL> wrote:
     

    Stop - and put it back where it was. Once you start fiddling with an Oracle
    install like this, Bad Things Happen.
     

    Hm, not a good sign.
     

    What version of Oracle and PHP?

    As for the permissions, as well as Read and Execute I've got List Folder
    Contents as well (makes sense since it might want to look for localised message
    files?)

    Do you have more than one Oracle home on the system?

    --
    Andy Hassall <co.uk> / Space: disk usage ysis tool
    <http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
    Andy Guest

  6. #6

    Default Re: PHP OCI8

    On Sat, 07 Feb 2004 19:53:03 +0000, Andy Hassall <co.uk>
    wrote:
     
    >>
    >>I posted them at about the same time so there wasn't an asnwer yet.
    >>You seem to know so tell me.... how should I ask the same question in
    >>more than 1 group?[/ref]
    >
    > Don't send several separate messages (multiposting - wastes time because
    >replies to one thread don't appear in the other), instead put multiple
    >newsgroup names (separated with commas) in the Newsgroups box when posting
    >(crossposting - all replies go to all groups, so you get a single, larger
    >discussion rather than multiple fragmented ones).[/ref]

    I will in future. Thanks.

    Roger
    PIII450@HOME.NL Guest

  7. #7

    Default Re: PHP OCI8

    On Fri, 06 Feb 2004 20:07:52 +0100, "NL" <NL> wrote:
     
    >>
    >> Don't multipost - see reply in comp.lang.php.[/ref]
    >
    >I posted them at about the same time so there wasn't an asnwer yet.
    >You seem to know so tell me.... how should I ask the same question in
    >more than 1 group?[/ref]

    Don't send several separate messages (multiposting - wastes time because
    replies to one thread don't appear in the other), instead put multiple
    newsgroup names (separated with commas) in the Newsgroups box when posting
    (crossposting - all replies go to all groups, so you get a single, larger
    discussion rather than multiple fragmented ones).

    --
    Andy Hassall <co.uk> / Space: disk usage ysis tool
    <http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
    Andy Guest

  8. #8

    Default Re: PHP OCI8

    On Sun, 08 Feb 2004 22:06:03 +0000, Andy Hassall <co.uk>
    wrote:
     
    >
    > It's often best to trim everything down to basics when it starts Doing Weird
    >Things. The corrupted-looking message probably qualifies as weird.
    >
    > A checklist off the top of my head, if you post replies to each point at least
    >it'll show where you stand:
    >
    >(1) Environment:
    >
    > What's in PATH?
    >
    >echo $_ENV['PATH'];
    >
    > Where's your Oracle home?
    >
    >echo $_ENV['ORACLE_HOME'];
    >
    > Although this may well not be set, since you're not actually supposed to set
    >ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
    >information in the registry instead).
    >
    > Others:
    >
    >echo $_ENV['TNS_ADMIN'];
    >echo $_ENV['NLS_LANG'];
    >
    >(2) Does sqlplus work from the command line?
    >
    > sqlplus username/passworddatabase
    >
    > < do some stuff like select sysdate from dual >
    >
    >(3) Does sqlplus work from PHP?
    >
    ><pre>
    ><?php
    >$descriptorspec = array(
    > 0 => array("pipe", "r"),
    > 1 => array("pipe", "w"),
    > 2 => array("pipe", "w")
    >);
    >$process = proc_open("sqlplus test/testdev92lnx", $descriptorspec, $pipes);
    >if (is_resource($process)) {
    > fwrite($pipes[0], "select sysdate from dual;\n");
    > fclose($pipes[0]);
    >
    > while(!feof($pipes[1])) {
    > echo fgets($pipes[1], 1024);
    > }
    > fclose($pipes[1]);
    > $return_value = proc_close($process);
    >
    > echo "command returned $return_value\n";
    >}
    >?>
    ></pre>
    >
    >(4) What does a minimal OCI8 example do? (alter username/password/database as
    >necessary):
    >
    ><pre>
    ><?php
    >putenv("NLS_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");
    >
    >if (!$conn = OCILogon("test","test","dev92lnx")) {
    > $err = OCIError();
    > die($err['message']);
    >}
    >
    >print "<hr>Server Version: " . OCIServerVersion($conn) . "<hr>";
    >
    >if (!$stmt = OCIP($conn,"
    >select sysdate from dual
    >")) {
    > $err = OCIError();
    > die($err['message']);
    >}
    >
    >if (!OCIExecute($stmt)) {
    > $err = OCIError();
    > die($err['message']);
    >}
    >
    >while (OCIFetchInto($stmt, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {
    > print_r($row);
    >}
    >
    >OCIFreeStatement($stmt);
    >OCILogoff($conn);
    >?>
    ></pre>[/ref]

    I'll give it a go tomorrow and tell you what happened :))

    Thanks so far.

    Roger
    PIII450@HOME.NL Guest

  9. #9

    Default Re: PHP OCI8

    On Sat, 07 Feb 2004 23:49:40 +0100, "NL"
    <NL> wrote:
     
    >>
    >> It's often best to trim everything down to basics when it starts Doing Weird
    >>Things. The corrupted-looking message probably qualifies as weird.
    >>
    >> A checklist off the top of my head, if you post replies to each point at least
    >>it'll show where you stand:
    >>
    >>(1) Environment:
    >>
    >> What's in PATH?
    >>
    >>echo $_ENV['PATH'];
    >>
    >> Where's your Oracle home?
    >>
    >>echo $_ENV['ORACLE_HOME'];
    >>
    >> Although this may well not be set, since you're not actually supposed to set
    >>ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
    >>information in the registry instead).
    >>
    >> Others:
    >>
    >>echo $_ENV['TNS_ADMIN'];
    >>echo $_ENV['NLS_LANG'];
    >>
    >>(2) Does sqlplus work from the command line?
    >>
    >> sqlplus username/passworddatabase
    >>
    >> < do some stuff like select sysdate from dual >
    >>
    >>(3) Does sqlplus work from PHP?
    >>
    >><pre>
    >><?php
    >>$descriptorspec = array(
    >> 0 => array("pipe", "r"),
    >> 1 => array("pipe", "w"),
    >> 2 => array("pipe", "w")
    >>);
    >>$process = proc_open("sqlplus test/testdev92lnx", $descriptorspec, $pipes);
    >>if (is_resource($process)) {
    >> fwrite($pipes[0], "select sysdate from dual;\n");
    >> fclose($pipes[0]);
    >>
    >> while(!feof($pipes[1])) {
    >> echo fgets($pipes[1], 1024);
    >> }
    >> fclose($pipes[1]);
    >> $return_value = proc_close($process);
    >>
    >> echo "command returned $return_value\n";
    >>}
    >>?>
    >></pre>
    >>
    >>(4) What does a minimal OCI8 example do? (alter username/password/database as
    >>necessary):
    >>
    >><pre>
    >><?php
    >>putenv("NLS_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");
    >>
    >>if (!$conn = OCILogon("test","test","dev92lnx")) {
    >> $err = OCIError();
    >> die($err['message']);
    >>}
    >>
    >>print "<hr>Server Version: " . OCIServerVersion($conn) . "<hr>";
    >>
    >>if (!$stmt = OCIP($conn,"
    >>select sysdate from dual
    >>")) {
    >> $err = OCIError();
    >> die($err['message']);
    >>}
    >>
    >>if (!OCIExecute($stmt)) {
    >> $err = OCIError();
    >> die($err['message']);
    >>}
    >>
    >>while (OCIFetchInto($stmt, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {
    >> print_r($row);
    >>}
    >>
    >>OCIFreeStatement($stmt);
    >>OCILogoff($conn);
    >>?>
    >></pre>[/ref]
    >
    >I'll give it a go tomorrow and tell you what happened :))
    >
    >Thanks so far.
    >
    >Roger[/ref]

    I found it :)) It all started with the $_ENV['PATH'] you suggested.
    The above mentioned occurred on 2 machines. When I did the set in a
    command windows the ora\bin was in the PATH. When I looked at the
    $_ENV['PATH'] it wasn't. Don't ask me why but just restarting IIS and
    loading php again didn't do the trick. A reboot of the server was
    needed. Afterwards PHP and OCI worked on 1 of the machines :)) When I
    took a closer look the second machine had a second ora home. Don't ask
    me why but those idiots from Atos installed oracle twice. I added the
    second ora\bin to the PATH, rebooted the machine and now this one is
    working as well :))

    Thanks for your help and the lesson learned? Always reboot M$
    Winds after installing or changing something.
    PIII450@HOME.NL Guest

  10. #10

    Default Re: PHP OCI8

    On Fri, 06 Feb 2004 20:27:14 +0100, "NL" <NL> wrote:
     

    It's often best to trim everything down to basics when it starts Doing Weird
    Things. The corrupted-looking message probably qualifies as weird.

    A checklist off the top of my head, if you post replies to each point at least
    it'll show where you stand:

    (1) Environment:

    What's in PATH?

    echo $_ENV['PATH'];

    Where's your Oracle home?

    echo $_ENV['ORACLE_HOME'];

    Although this may well not be set, since you're not actually supposed to set
    ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
    information in the registry instead).

    Others:

    echo $_ENV['TNS_ADMIN'];
    echo $_ENV['NLS_LANG'];

    (2) Does sqlplus work from the command line?

    sqlplus username/passworddatabase

    < do some stuff like select sysdate from dual >

    (3) Does sqlplus work from PHP?

    <pre>
    <?php
    $descriptorspec = array(
    0 => array("pipe", "r"),
    1 => array("pipe", "w"),
    2 => array("pipe", "w")
    );
    $process = proc_open("sqlplus test/testdev92lnx", $descriptorspec, $pipes);
    if (is_resource($process)) {
    fwrite($pipes[0], "select sysdate from dual;\n");
    fclose($pipes[0]);

    while(!feof($pipes[1])) {
    echo fgets($pipes[1], 1024);
    }
    fclose($pipes[1]);
    $return_value = proc_close($process);

    echo "command returned $return_value\n";
    }
    ?>
    </pre>

    (4) What does a minimal OCI8 example do? (alter username/password/database as
    necessary):

    <pre>
    <?php
    putenv("NLS_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");

    if (!$conn = OCILogon("test","test","dev92lnx")) {
    $err = OCIError();
    die($err['message']);
    }

    print "<hr>Server Version: " . OCIServerVersion($conn) . "<hr>";

    if (!$stmt = OCIP($conn,"
    select sysdate from dual
    ")) {
    $err = OCIError();
    die($err['message']);
    }

    if (!OCIExecute($stmt)) {
    $err = OCIError();
    die($err['message']);
    }

    while (OCIFetchInto($stmt, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {
    print_r($row);
    }

    OCIFreeStatement($stmt);
    OCILogoff($conn);
    ?>
    </pre>

    --
    Andy Hassall <co.uk> / Space: disk usage ysis tool
    <http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
    Andy Guest

  11. #11

    Default Re: PHP OCI8

    > Thanks for your help and the lesson learned? Always reboot M$ 

    That or learn how to setup stuff right in the first place --- bad carpenter
    will always blame his tools ....


    J00 Guest

  12. Moderated Post

    Default Re: PHP OCI8

    Removed by Administrator
    Andy Guest
    Moderated Post

Similar Threads

  1. #38960 [NEW]: OCI8 failure...
    By sn4265 at att dot com in forum PHP Bugs
    Replies: 8
    Last Post: September 27th, 10:26 PM
  2. OCI8 on PHP with Oracle 9i
    By Chad in forum PHP Development
    Replies: 3
    Last Post: January 8th, 07:39 PM
  3. [PHP-DEV] changes in oci8
    By Antony in forum PHP Development
    Replies: 4
    Last Post: December 23rd, 02:23 PM
  4. [PHP-DEV] oci8 ext [was cvs: CVSROOT / avail]
    By Edin in forum PHP Development
    Replies: 7
    Last Post: December 9th, 04:59 PM
  5. Experience with PHP & Oracle 9.2.0/OCI8
    By Ollivier Robert in forum PHP Development
    Replies: 1
    Last Post: June 25th, 04:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139