OCI8

OCI8

am 13.08.2004 14:29:20 von Yannick GUENET

I have some trouble with Oracle Database and php...

see this code:
while (1) {
$conn=OCILogon($username,$password,$database);
$stmt=OCIParse($conn,"select 50 as toto from dual");
OCIDefineByName($stmt,"TOTO",&$total);
OCIExecute($stmt);
OCIFetch($stmt);
echo ":::$total:::\n";
OCILogoff($conn);
$err=OCIError($conn);
OCILogoff($conn);
sleep(10);
}
?>

when i execute it, the number of fd on ocius.msg is growing. but there is
only 1 connection at database.

Can someone help me ?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: OCI8

am 13.08.2004 15:12:28 von Christopher Jones

It might be a feature of PHP's connection caching. Why don't
you log a bug in the PHP bug DB so the problem can be tracked?

Do you really need to keep reconnecting?
See http://www.oracle.com/technology/tech/opensource/php/php_tro ubleshooting_faq.html#conmgt

Chris


yannick wrote:

> I have some trouble with Oracle Database and php...
>
> see this code:
> > while (1) {
> $conn=OCILogon($username,$password,$database);
> $stmt=OCIParse($conn,"select 50 as toto from dual");
> OCIDefineByName($stmt,"TOTO",&$total);
> OCIExecute($stmt);
> OCIFetch($stmt);
> echo ":::$total:::\n";
> OCILogoff($conn);
> $err=OCIError($conn);
> OCILogoff($conn);
> sleep(10);
> }
> ?>
>
> when i execute it, the number of fd on ocius.msg is growing. but there is
> only 1 connection at database.
>
> Can someone help me ?
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: OCI8

am 13.08.2004 15:18:32 von Yannick GUENET

i don t really need to keep reconnecting.

i made this script to reproduce problem with apache.

ie:apache's child keep a lot of Fd to ocius.msg .


-----Message d'origine-----
De : Christopher Jones [mailto:christopher.jones@oracle.com]
Envoye : vendredi 13 aout 2004 15:12
A : yannick
Cc : php-db@lists.php.net
Objet : Re: [PHP-DB] OCI8



It might be a feature of PHP's connection caching. Why don't
you log a bug in the PHP bug DB so the problem can be tracked?

Do you really need to keep reconnecting?
See
http://www.oracle.com/technology/tech/opensource/php/php_tro ubleshooting_faq
..html#conmgt

Chris


yannick wrote:

> I have some trouble with Oracle Database and php...
>
> see this code:
> > while (1) {
> $conn=OCILogon($username,$password,$database);
> $stmt=OCIParse($conn,"select 50 as toto from dual");
> OCIDefineByName($stmt,"TOTO",&$total);
> OCIExecute($stmt);
> OCIFetch($stmt);
> echo ":::$total:::\n";
> OCILogoff($conn);
> $err=OCIError($conn);
> OCILogoff($conn);
> sleep(10);
> }
> ?>
>
> when i execute it, the number of fd on ocius.msg is growing. but there is
> only 1 connection at database.
>
> Can someone help me ?
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: OCI8

am 13.08.2004 16:03:06 von M.Ford

On 13 August 2004 13:29, yannick wrote:

> I have some trouble with Oracle Database and php...
>
> see this code:
> > while (1) {
> $conn=OCILogon($username,$password,$database);

Try OCIPLogon() rather than OCILogon().

> $stmt=OCIParse($conn,"select 50 as toto from dual");
> OCIDefineByName($stmt,"TOTO",&$total);

Not related to your problem, but you don't need that & -- in fact, it's deprecated and may, one day, cause a parse error.

> OCIExecute($stmt);
> OCIFetch($stmt);
> echo ":::$total:::\n";
> OCILogoff($conn);
> $err=OCIError($conn);
> OCILogoff($conn);
> sleep(10);
> }
> >
>
> when i execute it, the number of fd on ocius.msg is growing. but
> there is only 1 connection at database.
>
> Can someone help me ?

Cheers!

Mike

------------------------------------------------------------ ---------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: OCI8

am 13.08.2004 16:40:43 von Yannick GUENET

Thanks for your help, but i tried with OCIPLogon, and get same result.


-----Message d'origine-----
De : Ford, Mike [LSS] [mailto:M.Ford@leedsmet.ac.uk]
Envoyé : vendredi 13 août 2004 16:03
À : 'yannick'; php-db@lists.php.net
Objet : RE: [PHP-DB] OCI8


On 13 August 2004 13:29, yannick wrote:

> I have some trouble with Oracle Database and php...
>
> see this code:
> > while (1) {
> $conn=OCILogon($username,$password,$database);

Try OCIPLogon() rather than OCILogon().

> $stmt=OCIParse($conn,"select 50 as toto from dual");
> OCIDefineByName($stmt,"TOTO",&$total);

Not related to your problem, but you don't need that & -- in fact, it's
deprecated and may, one day, cause a parse error.

> OCIExecute($stmt);
> OCIFetch($stmt);
> echo ":::$total:::\n";
> OCILogoff($conn);
> $err=OCIError($conn);
> OCILogoff($conn);
> sleep(10);
> }
> >
>
> when i execute it, the number of fd on ocius.msg is growing. but
> there is only 1 connection at database.
>
> Can someone help me ?

Cheers!

Mike

------------------------------------------------------------ ---------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: oci8

am 17.11.2008 00:41:19 von Christopher Jones

Hi Fred,

pecl-dev@lists.php.net is a development mail list. The best place to
post to is php-db@lists.php.net. I'm ccing that list: please remove
pecl-dev from any followup mail.

Fred Silsbee wrote:
> I have Fedora 9 2.6.27.5-37.fc9.i686 and Oracle 11g1

> oracle@LMKIII oci8-1.3.4$ phpize also tried phpize.php
> bash: phpize: command not found

I know on Redhat EL you need the php-pear and php-devel RPMs to get
pecl, pear and phpize.

> the README says to run ,/configure but there is only config.m4 and
> config.w32

phpize creates configure.

> I am trying to get a PHP connection to Oracle 11g1
>
> >
> if ($c = oci_connect('hr','hr','//localhost/lmkiiiGDNSID')) {
>
> echo "Successfully connected to Oracle.\n";
>
> OCILogoff($c);
>
> } else {
>
> $err = OCIError();
>
> echo "Oracle Connect Error " . $errtext;
>
> }
>
> ?>
> I get no errors just doesn't work!

Given the previous build failures it's unlikely this code will run.

If you haven't set display_errors to On in php.ini you won't see any
automatic PHP errors.

Also, your error printing code should look like:

echo "Oracle Connect Error " . $err['message]';

For information on OCI8 there are a number of books available,
including my free PDF book at http://tinyurl.com/f8jad. (A new
version of this book should be out in the next week or so: I've just
finished my edits on it.)

Chris

--
Email: christopher.jones@oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/f8jad