Home > Database > Mysql Tutorial > body text

php客户端连接Oracle数据库

WBOY
Release: 2016-06-07 17:40:55
Original
910 people have browsed it

php连接访问Oracle是用过oci函数,以下是整理的文档1.安装Apache和php包yuminstall-yhttpdphp*2.下载Oracle组件oracle-instantclient-basic-10.2.0.4-1.i386.rpm

php连接访问Oracle是用过oci函数,香港虚拟主机,以下是整理的文档

1.安装Apache和php包 

  • yum install -y httpd php* 
  • 2.下载Oracle组件

    oracle-instantclient-basic-10.2.0.4-1.i386.rpm

    oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm

    oracle-instantclient-devel-10.2.0.4-1.i386.rpm

    oracle-instantclient-odbc-10.2.0.4-1.i386.rpm

    #rpm -ivh oracle-instantclient*(四个组件全部安装上)

    此时会生成/usr/lib/oracle/10.2.0.4/client/lib/目录

    3.修改/etc/ld.so.conf文件

    #vim /etc/ld.so.conf

    追加以下内容

    /usr/lib/oracle/10.2.0.4/client/lib/

    #ldconfig(执行命令)

    4.下载OCI8组件

    #tar zxvf oci8-1.4.1.tgz

    5.编辑OCI8模块

    #cd oci8-1.4.1

    #phpize(执行命令)

    #./configure --with-oci8=instantclient,/usr/lib/oracle/10.2.0.4/client/lib/

    #make install

    成功后系统会提示你:oci8.so已经成功放入/usr/lib/php/modules/目录中

    6.修改php.ini文件

    #vim /etc/php.ini

    追加以下内容

    extension=oci8.so

    7.重启Apache服务

    service httpd restart

    8.使用phpinfo()函数查看

    9.编辑php代码连接测试oracle数据库

    最后通过浏览器浏览页面

    本文出自 “老徐的私房菜” 博客,香港服务器,谢绝转载!

    ,网站空间
    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template