安装apache
./configure --prefix=/opt/apache2 --enable-module=so
编译php
./configure --prefix=/myhome/php-5 --with-gd --with-jpeg --with-jpeg-dir=/usr --with-zlib-dir=/usr/local --with-png-dir=/usr/local \
--with-apxs2=/myhome/apache2/bin/apxs --with-oci8=/oracle/oracle/product/10.2.0/db_7
修改apache配置文件httpd.conf
代码
LoadModule php5_module modules/libphp5.so
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_admin_flag magic_quotes_gpc Off
php_admin_flag magic_quotes_runtime Off
</IfModule>
测试数据库连接
代码
<?php$sql="select * from wh_hosts";?>
$db_conn = oci_connect( "sys", "tiger","sid" );
$stmt = ociparse($db_conn, $sql);
ociexecute($stmt);
$nrows = oci_fetch_all($stmt, $results);
oci_free_statement($stmt);
oci_close($db_conn);