You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Garnier, Jeremie" <JG...@nds.com> on 2007/01/18 15:30:13 UTC

APR, Oracle and PHP & CGI

Hi all,

 

I don't know why the test dbd works fine but when i make a cgi in order to use it. It doesn't work.

It loads the oracle driver (via the function apr_dbd_get_driver but the function a^pr_dbd_open doesn't work (into apache, not with the dbd program (in httpd/srclib/apr-util/test)).

Thanks

 

Jérémie GARNIER

 

-----Message d'origine-----
De : Bojan Smojver [mailto:bojan@rexursive.com] 
Envoyé : mercredi 17 janvier 2007 22:32
À : Garnier, Jeremie
Cc : Justin Erenkrantz; dev@apr.apache.org
Objet : RE: APR, Oracle and PHP

 

On Wed, 2007-01-17 at 12:24 +0100, Garnier, Jeremie wrote:

 

> I juste have a question. When I compile APR/APU with oracle, why I

> don't I the library apr_dbd_oracle.so?

 

Are PHP and Apache linked against the new APU? What does ldd give you?

 

AFAIK, once you compile the Oracle driver in 1.3.0, it becomes part of

libaprutil - it's not a standalone shared object. That's at least how

libaprutil looks on my machine.

 

I would run ldd/nm to see what is actually in the libaprutil that your

PHP and/or Apache link against. There should be dbd_oracle_* symbols in

it...

 

-- 

Bojan

 

***********************************************************************************
Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
*********************************************************************************** 


RE: APR, Oracle and PHP & CGI

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting "Garnier, Jeremie" <JG...@nds.com>:

> I see on my cgi that the function OCIHandleAlloc returns -2... Why   
> this function does not work on my cgi? It is a problem with the   
> dbd_oracle_env?

I have to admit that my Oracle experience isn't great, so I wouldn't  
even venture a guess. I'm not even sure what -2 as a return code there  
means, but maybe you can turn on debugging (examples are in the  
driver) and this should give you better information as to what kind of  
problem Oracle is having.

> Another question: where can I find some documentation/examples using  
>  mod_dbd. The aim is to use mod_dbd in order to manage pooling.  
> First  I test APR/APU and after APR/APU works, I will test mod_dbd...

Most likely one of the Apache lists, as mod_dbd is part of Apache.

-- 
Bojan

RE: APR, Oracle and PHP & CGI

Posted by "Garnier, Jeremie" <JG...@nds.com>.
Hi all,

There is always the problem on my cgi whereas there is not this problem with the dbd test program.
I see on my cgi that the function OCIHandleAlloc returns -2... Why this function does not work on my cgi? It is a problem with the dbd_oracle_env?
Another question: where can I find some documentation/examples using mod_dbd. The aim is to use mod_dbd in order to manage pooling. First I test APR/APU and after APR/APU works, I will test mod_dbd...
Thanks,

Jérémie

-----Message d'origine-----
De : Bojan Smojver [mailto:bojan@rexursive.com] 
Envoyé : vendredi 19 janvier 2007 00:36
À : Garnier, Jeremie
Cc : Justin Erenkrantz; dev@apr.apache.org
Objet : Re: APR, Oracle and PHP & CGI

Quoting "Garnier, Jeremie" <JG...@nds.com>:

> I don't know why the test dbd works fine but when i make a cgi in   
> order to use it. It doesn't work.
>
> It loads the oracle driver (via the function apr_dbd_get_driver but   
> the function a^pr_dbd_open doesn't work (into apache, not with the   
> dbd program (in httpd/srclib/apr-util/test)).

Your best bet is probably to run the program under GDB to see what's  
really going on.

-- 
Bojan
***********************************************************************************
Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
*********************************************************************************** 


Re: APR, Oracle and PHP & CGI

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting "Garnier, Jeremie" <JG...@nds.com>:

> I don't know why the test dbd works fine but when i make a cgi in   
> order to use it. It doesn't work.
>
> It loads the oracle driver (via the function apr_dbd_get_driver but   
> the function a^pr_dbd_open doesn't work (into apache, not with the   
> dbd program (in httpd/srclib/apr-util/test)).

Your best bet is probably to run the program under GDB to see what's  
really going on.

-- 
Bojan

RE: APR, Oracle and PHP & CGI.. and now mod_dbd

Posted by Bojan Smojver <bo...@rexursive.com>.
On Mon, 2007-01-22 at 12:31 +0100, Garnier, Jeremie wrote:

> Now, I will use mod_dbd… Do you know how include mod_dbd API in a cgi
> script (or C program) as there no example or documentation of mod_dbd…

Never tried that, so I won't be of much help there.

-- 
Bojan


RE: APR, Oracle and PHP & CGI.. and now mod_dbd

Posted by "Garnier, Jeremie" <JG...@nds.com>.
Hi all,

 

So have some news about APR/APU, Oracle and PHP & CGI... 

I make a CGI script and I can access to the Oracle XE database... To resolve the problem, I make some modification in order to link apache with APR/APU and in the driver of oracle (make another initialisation of the environment)...

And so, it works!!! Good results...

Now, I will use mod_dbd... Do you know how include mod_dbd API in a cgi script (or C program) as there no example or documentation of mod_dbd...

Thanks all for your help...

 

Jérémie GARNIER

 

-----Message d'origine-----
De : Bojan Smojver [mailto:bojan@rexursive.com] 
Envoyé : vendredi 19 janvier 2007 00:48
À : Garnier, Jeremie
Cc : Justin Erenkrantz; dev@apr.apache.org
Objet : Re: APR, Oracle and PHP & CGI

 

Quoting "Garnier, Jeremie" <JG...@nds.com>:

 

> It loads the oracle driver (via the function apr_dbd_get_driver but   

> the function a^pr_dbd_open doesn't work (into apache, not with the   

> dbd program (in httpd/srclib/apr-util/test)).

 

One more suggestion here: I had some issues with Oracle Instant Client  

10g connecting to the database and the whole thing was related to  

server spec passed to the driver. It had to be like this:  

//server.domain.name:port/db, where all values were as specified in  

/etc/tnsnames.ora file. You may also want to check the environment  

variables that your Apache instance sees - Oracle may need some set.

 

-- 

Bojan

***********************************************************************************
Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
*********************************************************************************** 


Re: APR, Oracle and PHP & CGI

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting "Garnier, Jeremie" <JG...@nds.com>:

> It loads the oracle driver (via the function apr_dbd_get_driver but   
> the function a^pr_dbd_open doesn't work (into apache, not with the   
> dbd program (in httpd/srclib/apr-util/test)).

One more suggestion here: I had some issues with Oracle Instant Client  
10g connecting to the database and the whole thing was related to  
server spec passed to the driver. It had to be like this:  
//server.domain.name:port/db, where all values were as specified in  
/etc/tnsnames.ora file. You may also want to check the environment  
variables that your Apache instance sees - Oracle may need some set.

-- 
Bojan