Chinaunix首页 | 论坛 | 博客
  • 博客访问: 277558
  • 博文数量: 78
  • 博客积分: 3018
  • 博客等级: 少校
  • 技术积分: 950
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-07 02:33
文章分类

全部博文(78)

文章存档

2013年(1)

2012年(19)

2011年(45)

2008年(13)

分类: LINUX

2011-12-12 16:18:41

1.编译
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs  --with-oci8=/home/oracle/oracle10gr2/product/10.2.0/db_1/ --with-pdo-oci=/home/oracle/oracle10gr2/product/10.2.0/db_1/ --enable-soap --enable-ftp --enable-mbstring=all --enable-mbregex --with-zlib-dir=/usr/ --with-jpeg-dir=/usr/ --with-png-dir=/usr/ --with-freetype-dir=/usr/ --with-gd=/usr/ --enable-gd-native-ttf --enable-gd-jis-conv --with-openssl=/usr/local/openssl/
#make && make install
 
 
2.测试oracle连接
#cd /var/www/html
#vim conn.php
$conn = oci_connect('system', 'imjx', 'orcl');
if (!$conn) {
    $e = oci_error();
    print htmlentities($e['message']);
    exit;
}else {
    echo "连接oracle成功!";
}
?>
刚开始访问时报错:
Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /var/www/html/conn.php on line 3
运行Apache的用户的Oracle权限问题
# vim /usr/local/apache/conf/httpd.conf
User oracle
Group dba
 
//重启apache测试连接成功
阅读(894) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~