Re: PHP not working w/ Oracle (fwd)
| From: | thies at digicol dot de | Date: | Thu, 02 Mar 2000 11:35:38 +0000 |
| Subject: | Re: PHP not working w/ Oracle (fwd) | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16265@lists.php.net to get a copy of this message | ||
the problem is most likely that you have not installed the
needed patch for 8.1.5 on linux, without that all oci7 calls
(like olog()..) will fail.
BTW: the oci8 driver (oci*()) will work (without the
mentioned patch) ! plus you should be able to use it - even
against a 7.x database!
BTW2: in your testcase you forgot to link with _any_ oracle
library - therefore the link-errors
tc
On Wed, Mar 01, 2000 at 04:54:48PM -0800, Rasmus Lerdorf wrote:
> Anybody have a clue on this one? I haven't fiddled with Oracle7 for ages.
>
> ---------- Forwarded message ----------
> Date: Wed, 01 Mar 2000 14:06:38 -0800
> From: Ray Clouse <ray.clouse@boeing.com>
> To: ssb@fast.no, rasmus@lerdorf.on.ca
> Cc: Heiko Jones <heiko.jones@boeing.com>, Rick Herbel <rick.herbel@boeing.com>
> Subject: PHP not working w/ Oracle
>
> Hiya. Saw your names in the CREDITS file, so I'm hoping you can give us
> a clue as to what we're doing wrong or what we can do to get past our
> problem.
>
> OK, what we're trying to do is access an Oracle 7.3.6 database on a
> remote server from Apache & PHP running on a Linux box. We got the
> fullblown Oracle 8.1.5, installed it, and generated Apache & PHP3 from
> Apache Kit 5.2. We tested the Oracle stuff using SQLPlus, and we can
> access the remote database instances just fine. I run Apache (httpd -X)
> so we can see the error messages. I test it with this PHP3 page:
>
> <html>
> <head>
> <title>Example</title>
> </head>
> <body>
> <?php echo "Hi, I'm an Oracle PHP script!"; ?>
> <?php $conn = Ora_Logon("luser@remote", "password"); ?>
> <?php echo "Here's the connection result: " $conn; ?>
> </body>
> </html>
>
> Apache segfaults. In php-3.0.15/functions/oracle.c, I've found that the
> segfault occurs at this line:
>
> if (orlon(&db_conn->lda, db_conn->hda, user,
> strlen(user), pwd, strlen(pwd), 0)) {
>
> orlon is a function in libclntsh.so.8.0, for which we cannot find the
> source. So, I wrote this little program to try to test orlon:
>
> #include "oracle.h"
> #include "ocidfn.h"
> #include <stdio.h>
>
> #define HDA_SIZE 256
>
> typedef struct {
> int open;
> Lda_Def lda;
> ub1 hda[HDA_SIZE];
> } oraConnection;
>
> int main()
> {
> oraConnection *db_conn;
>
> db_conn = (oraConnection *)malloc(sizeof(oraConnection));
> orlon(&db_conn->lda, db_conn->hda, "luser@remote",
> strlen("luser@remote"), "password", strlen("password"), 0);
> }
>
> Unfortunately we get an undefined reference:
>
> gcc -g -O2 -O2 -I. -I. -I/u01/app/oracle/product/8.1.5/rdbms/demo \
> ? -I/u01/app/oracle/product/8.1.5/network/public \
> ? -I/u01/app/oracle/product/8.1.5/plsql/public \
> ? -o test test.c
> /tmp/ccX1L2WN.o: In function `main':
> /home/clouse/spacl/test.c:20: undefined reference to `orlon'
> collect2: ld returned 1 exit status
>
> If either of you have any ideas, please let us know. Thank you.
>
> --
> -------------------------------------------------------------------------
> Ray Clouse | Don't fear the
> penguins.
> Engineer Scientist/Specialist |
> Boeing Expendable Launch Vehicles | Ray.Clouse AT boeing.com
> Huntington Beach, CA | rclouse AT penguinpowered.com
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany