编译PHP-oci8支持Oracle102G,
Apache 1.3 && php4
Apache 2.0 && php5
mkdir $HOME/httpd
mkdir $HOME/httpd/www
rpm -Uvh oracle-instantclient-basic-10.2.0.3-1.i386.rpm
rpm -Uvh oracle-instantclient-devel-10.2.0.3-1.i386.rpm
./configure --prefix=$HOME/httpd --enable-module=so
mkdir $HOME/php
./configure \
--with-oci8-instant-client \
--prefix=$HOME/php --with-apxs=$HOME/httpd/bin/apxs \
--enable-sigchild --with-config-file-path=$HOME/httpd/conf
cp php.ini-recommended $HOME/httpd/conf/php.ini
#! /bin/sh
$HOME=/home/apache
LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
echo Starting Apache
$HOME/httpd/bin/apachectl start
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
$conn = OCILogon("hr", "hr_password", '//mymachine.mydomain:port/MYDB');
$query = 'select table_name from user_tables';
$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "
\n";
}
OCILogoff($conn);
?>
根据需要:
{修改/home/apache/httpd/conf/php.ini 381行 为register_globals = On}
# User specific environment and startup programs
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=raddb
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
#PATH=$PATH:$HOME/bin
阅读(2830) | 评论(0) | 转发(0) |