#38811 [Fbk->Csd]: compilation fails with --with-oci8 support
| From: | murthys at us dot ibm dot com | Date: | Wed, 13 Sep 2006 22:36:24 +0000 |
| Subject: | #38811 [Fbk->Csd]: compilation fails with --with-oci8 support | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-102139@lists.php.net to get a copy of this message | ||
ID: 38811
User updated by: murthys at us dot ibm dot com
Reported By: murthys at us dot ibm dot com
-Status: Feedback
+Status: Closed
Bug Type: Compile Failure
Operating System: AIX 5.3 ML-03
PHP Version: 4.4.4
New Comment:
Hi Tony:
Thank you for your quick response.
1)
I downloaded the code from:
http://snaps.php.net/php4-STABLE-latest.tar.gz
2)
I was able to build the PHP 4.4.4 with OCI support correctly
#!/usr/bin/bash
export pct="%"
export RUNTIME="$(date +${pct}Y${pct}m${pct}d-${pct}H${pct}M${pct}S)"
export CONFIG_SHELL=/usr/bin/bash
export TOPDIR=/work
export SRCDIR=${TOPDIR}/php-4.4.4
export OBJSRC=${TOPDIR}/objsrc-php-4.4.4
export LOGFILE=${TOPDIR}/logs/
basename $0-log-${RUNTIME}
export PREFIX=/usr/php-4.4.4
export OPENLDAP_DIR=/usr/openldap-2.2.23
export ZLIB_DIR=/opt/freeware/
export APACHE_DIR=/usr/apache-2.0.55
export PATH="$PATH:/usr/local/bin:/opt/freeware/bin:"
export LVL=4.0.2
export GCC_DIR="/usr/gcc402-bs_gcc334"
export CC="${GCC_DIR}/bin/gcc"
export CPPFLAGS="-I/opt/freeware/include "
export CPPFLAGS="$CPPFLAGS -I/usr/local/openssl/include"
export CPPFLAGS="$CPPFLAGS -I/opt/freeware/include/openssl "
export CPPFLAGS="$CPPFLAGS -I${GCC_DIR}/include/c++/${LVL}"
export CPPFLAGS="$CPPFLAGS -I${GCC_DIR}/include/c++/${LVL}/backward"
export CPPFLAGS="$CPPFLAGS -I${GCC_DIR}/include/c++/${LVL}/bits "
export CPPFLAGS="$CPPFLAGS -I${GCC_DIR}/include/c++/${LVL}/debug"
export CPPFLAGS="$CPPFLAGS -I${GCC_DIR}/include/c++/${LVL}/ext"
export CPPFLAGS="$CPPFLAGS
-I${GCC_DIR}/include/c++/${LVL}/powerpc-ibm-aix5.3.0.0"
export CPPFLAGS="$CPPFLAGS
-I${GCC_DIR}/include/c++/${LVL}/powerpc-ibm-aix5.3.0.0/bits"
export CPPFLAGS="$CPPFLAGS
-I${GCC_DIR}/include/c++/${LVL}/powerpc-ibm-aix5.3.0.0/bits/stdc++.h.g
ch"
export CPPFLAGS="$CPPFLAGS -I/usr/csapps/db/rdbms/demo
-I/work/php-4.4.4/ext/oci8"
export LDFLAG="-L/opt/freeware/lib -L${OPENLDAP_DIR}/lib
-L/usr/local/lib"
{
echo "START: date"
echo "========================================="
if [[ ${PWD} != "${OBJSRC}" ]]; then
echo " ERROR !!! This script must be run from '${OBJSRC}'
directory"
exit 1
fi
case $1 in
-config)
cmd="${SRCDIR}/configure --srcdir=${SRCDIR}
--with-ldap=${OPENLDAP_DIR} --with-zlib-dir=${ZLIB_DIR
} --with-openssl=/opt/freeware/ --with-apxs2=${APACHE_DIR}/bin/apxs
--with-mime-magic=${APACHE_DIR}/
conf/magic --prefix=${PREFIX} --disable-cgi --with-layout=GNU
--enable-ipv6 --enable-memory-limit --
without-mysql --enable-sysvsem --enable-sysvshm --enable-sysvmsg
--enable-bcmath --enable-ctype --wi
th-exec-dir=/usr/lib/php4/libexec --disable-static --with-regex=php
--with-as=/usr/ccs/bin/as --wit
h-ld=/usr/ccs/bin/ld --with-ar=/usr/ccs/bin/ar
--exec-prefix=/usr/php-4.4.4 --bindir=/usr/php-4.4.4
/bin --sbindir=/usr/php-4.4.4/sbin --libexecdir=/usr/php-4.4.4/libexec
--libdir=/usr/php-4.4.4/lib/
--with-oci8=/usr/csapps/db"
echo "COMMAND: '${cmd}'"
${SRCDIR}/configure --srcdir=${SRCDIR} --with-ldap=${OPENLDAP_DIR}
--with-zlib-dir=${ZLIB_DIR} --w
ith-openssl=/opt/freeware/ --with-apxs2=${APACHE_DIR}/bin/apxs
--with-mime-magic=${APACHE_DIR}/conf/
magic --prefix=${PREFIX} --disable-cgi --with-layout=GNU --enable-ipv6
--enable-memory-limit --witho
ut-mysql --enable-sysvsem --enable-sysvshm --enable-sysvmsg
--enable-bcmath --enable-ctype --with-ex
ec-dir=/usr/lib/php4/libexec --disable-static --with-regex=php
--with-as=/usr/ccs/bin/as --with-ld=
/usr/ccs/bin/ld --with-ar=/usr/ccs/bin/ar --exec-prefix=/usr/php-4.4.4
--bindir=/usr/php-4.4.4/bin
--sbindir=/usr/php-4.4.4/sbin --libexecdir=/usr/php-4.4.4/libexec
--libdir=/usr/php-4.4.4/lib/ --w
ith-oci8=/usr/csapps/db
echo "RC($?)"
echo "=========================================" ;;
-make)
echo "COMMAND: 'gmake'"
gmake
echo "RC($?)"
echo "=========================================" ;;
*)
echo " build-php.4.4.4.bash [ -config | -make ] "
exit 0 ;;
esac
echo "END: date"
} 2>&1 | tee ${LOGFILE}
3)
I used the following script to build it:
4)
I tested the PHP with OCI support using the following PHP test
script.
////////////////////////////////////////////////////////
// test_oci8.php - A simple script to verify OCI support for PHP
<?php
//$db_id = "fsdba";
$user = "fsdba";
$pass = "fsdba";
$tnsalias = "pitkin";
$tnsalias = "oracle-idb";
// log on to oracle server using data above
if ( $db_id = @OCILogon ($user, $pass, $tnsalias)) {
//sql query
$queryOne = @OCIParse($db_id, 'SELECT COUNT(*) FROM dual');
//execute above query
if(OCIExecute($queryOne, OCI_DEFAULT)) {
echo 'Congratulations, Connection & Query Successful!!';
}
else{
echo 'Sorry, Query Unsuccessful';
}
}
else {
echo 'Sorry, Connection Unsuccessful';
}
?>
//////////////////////////////////////////////////////////
Once again, thank you for helping me out with this.
Previous Comments:
------------------------------------------------------------------------
[2006-09-13 16:59:22] tony2001@php.net
Or even better - use OCI8 1.2.2 from PECL.
------------------------------------------------------------------------
[2006-09-13 16:59:02] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2006-09-13 15:43:33] murthys at us dot ibm dot com
Inadrtantly I indicated my e-mail address to be murthys@us.ib.com.
Kindly make a correction and it should be
murthys@us.ibm.com
------------------------------------------------------------------------
[2006-09-13 15:38:18] murthys at us dot ibm dot com
Description:
------------
Hi:
I am trying to build mod_php with oci8 support and I am running into
compile errors that are related to php-4.4.2/ext/oci8/oci8.c file.
Is this a real BUG and has been fixed in php 4.4.4 or should I use a
patch of some kind ?
1)
When option " --with-oci8=/usr/csapps/db " is EXCLUDED during
configure, the configure completes without errors and the make
completes successfully by building libphp4.so
The one line program
<?php
phpinfo();
?>
seem to work correctly
2)
When option " --with-oci8=/usr/csapps/db " is INCLUDED during
configure, the configure completes without errors and the make fails
as follows:
.........
.........
/usr/bin/bash /work/objsrc-php-4.4.2/libtool --silent
--preserve-dup-deps --mode=compile /usr/gcc402-bs_gcc334/bi
n/gcc -Iext/oci8/ -I/work/php-4.4.2/ext/oci8/ -DPHP_ATOM_INC
-I/work/objsrc-php-4.4.2/include -I/work/objsrc-php
-4.4.2/main -I/work/php-4.4.2 -I/opt/freeware//include
-I/usr/openldap-2.2.23/include -I/usr/csapps/db/rdbms/publ
ic -I/usr/csapps/db/rdbms/demo -I/work/php-4.4.2/ext/xml/expat
-I/work/objsrc-php-4.4.2/TSRM -I/work/objsrc-php-4
.4.2/Zend -I/work/php-4.4.2/main -I/work/php-4.4.2/Zend
-I/work/php-4.4.2/TSRM -I/work/objsrc-php-4.4.2/ -I/opt/
freeware/include -I/usr/local/openssl/include
-I/opt/freeware/include/openssl -I/usr/gcc402-bs_gcc334/include/c++
/4.0.2 -I/usr/gcc402-bs_gcc334/include/c++/4.0.2/backward
-I/usr/gcc402-bs_gcc334/include/c++/4.0.2/bits -I/usr/g
cc402-bs_gcc334/include/c++/4.0.2/debug
-I/usr/gcc402-bs_gcc334/include/c++/4.0.2/ext
-I/usr/gcc402-bs_gcc334/inc
lude/c++/4.0.2/powerpc-ibm-aix5.3.0.0
-I/usr/gcc402-bs_gcc334/include/c++/4.0.2/powerpc-ibm-aix5.3.0.0/bits
-I/us
r/gcc402-bs_gcc334/include/c++/4.0.2/powerpc-ibm-aix5.3.0.0/bits/stdc++.h.gch
-Iusr/csapps/db -g -O2 -c /work/
php-4.4.2/ext/oci8/oci8.c -o ext/oci8/oci8.lo
In file included from /work/php-4.4.2/ext/oci8/oci8.c:69:
/work/php-4.4.2/ext/oci8/php_oci8.h:59: error: syntax error before
'OCIServer'
/work/php-4.4.2/ext/oci8/php_oci8.h:59: warning: no semicolon at end of
struct or union
/work/php-4.4.2/ext/oci8/php_oci8.h:60: warning: data definition has no
type or storage class
/work/php-4.4.2/ext/oci8/php_oci8.h:61: warning: data definition has no
type or storage class
/work/php-4.4.2/ext/oci8/php_oci8.h:69: error: syntax error before
'oci_server'
/work/php-4.4.2/ext/oci8/php_oci8.h:69: warning: no semicolon at end of
struct or union
/work/php-4.4.2/ext/oci8/php_oci8.h:70: warning: data definition has no
type or storage class
/work/php-4.4.2/ext/oci8/php_oci8.h:71: error: syntax error before '*'
token
..................
..................
..................
gmake: *** [ext/oci8/oci8.lo] Error 1
I have searched the previously reported BUG articles about this problem
and some were related missing oci.h files, not providing correct PATHS
etc. I have checked all of the previously recommended solutions . They
do not resolve the problem I am seeing.
Any help and suggestion offered is gratefully acknowledged.
Regards,
Sridhar
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38811&edit=1