Click to See Complete Forum and Search --> : PHP3 + Oracle + Solaris7 x86


Anon
08-09-2000, 05:20 PM
Hello,

I am having trouble compiling Apache 1.3.12 with PHP 3.0.16 and Oracle support.

The configure & make process works fine for PHP, but when I go to make Apache, the process fails with the following error:

Undefined first referenced
symbol in file
OCIDescriptorAlloc modules/php3/libphp3.a(oci8.o)
OCITransRollback modules/php3/libphp3.a(oci8.o)
OCIErrorGet modules/php3/libphp3.a(oci8.o)
OCITransCommit modules/php3/libphp3.a(oci8.o)
OCIAttrSet modules/php3/libphp3.a(oci8.o)
OCIStmtPrepare modules/php3/libphp3.a(oci8.o)
OCIHandleAlloc modules/php3/libphp3.a(oci8.o)
OCIBindByName modules/php3/libphp3.a(oci8.o)
OCIAttrGet modules/php3/libphp3.a(oci8.o)
OCIInitialize modules/php3/libphp3.a(oci8.o)
OCISessionBegin modules/php3/libphp3.a(oci8.o)
OCIEnvInit modules/php3/libphp3.a(oci8.o)
OCILobWrite modules/php3/libphp3.a(oci8.o)
OCIServerVersion modules/php3/libphp3.a(oci8.o)
OCIParamGet modules/php3/libphp3.a(oci8.o)
OCILobRead modules/php3/libphp3.a(oci8.o)
OCIStmtExecute modules/php3/libphp3.a(oci8.o)
OCIServerDetach modules/php3/libphp3.a(oci8.o)
OCIStmtFetch modules/php3/libphp3.a(oci8.o)
OCIStmtSetPieceInfo modules/php3/libphp3.a(oci8.o)
OCIDescriptorFree modules/php3/libphp3.a(oci8.o)
OCILobFileOpen modules/php3/libphp3.a(oci8.o)
OCILobFileClose modules/php3/libphp3.a(oci8.o)
OCIServerAttach modules/php3/libphp3.a(oci8.o)
OCIBindDynamic modules/php3/libphp3.a(oci8.o)
OCILobGetLength modules/php3/libphp3.a(oci8.o)
OCIHandleFree modules/php3/libphp3.a(oci8.o)
OCISessionEnd modules/php3/libphp3.a(oci8.o)
OCIDefineByPos modules/php3/libphp3.a(oci8.o)
ld: fatal: Symbol referencing errors. No output written to httpd


This is being done on a Solaris7 INTEL system with the Oracle 8.0.5 client installed. gcc 2.95.2 is the compiler being used.

The environment variables $ORACLE_HOME, $ORACLE_BASE and $LD_LIBRARY_PATH have been defined

Any ideas would be appreciated.

Anon
08-10-2000, 04:45 AM
How did you configure apache and php ?

In order to compile PHP with OCI8 support you must run
./configure --with-oci8=$ORACLE_HOME ...

JBL

Anon
08-10-2000, 09:53 AM
I configured PHP as follows:

configure --enable-track-vars --with-apache=../apache_1.3.12 --with-oci8=$ORACLE_HOME

I then edited the config.h file and set the line
#define HAVE_OCI8 0
to
#define HAVE_OCI8 1

I then had to edit the Makefile in order to add a few additional paths for the include files.

Added
-I/usr/local/oracle/product/805/rdbms/demo -I/usr/local/oracle/product/805/plsql/public
-I/usr/local/oracle/product/805/network/public

to the INCLUDE line

and also added:

-L/usr/local/oracle/product/805/lib

to the LDFLAGS line of the Makefile

Then I ran make & make install, which reported no errors.

At this point I went on to build apache.

Anon
08-10-2000, 10:24 AM
I'm curious about why you had to modify config.h and Makefile. Usualy configure would have done it for you. Well, I don't think that's the problem.

It looks like it couldn't find Oracle Lib for linkage.
Did you add your path to the Oracle Lib ( /usr/local/oracle/product/805/lib in your case) in the /etc/ld.so.conf ( Not sure on Solaris ) or add it to the LD_LIBRARY_PATH env var ?

my env to compile apache+php+oracle is
ORACLE_HOME=/opt/oracle/product/8.0.5
LD_LIBRARY_PATH=/opt/oracle/product/8.0.5/lib


Let me know.



JBL

Anon
08-10-2000, 11:20 AM
I have already included /usr/local/oracle/product/805/lib in my LD_LIBRARY_PATH env variable.

My LD_LIBRARY_PATH is as follows
LD_LIBRARY_PATH = /usr/local/lib:/usr/lib:/lib:/usr/local/oracle/product/805/lib

I have also tried using the linker in /usr/ccs/bin/ld instead of /usr/ucb/ld, still getting the same error.