项目中遇到一个问题,即怎么在Windows下连接Oracle进行开发。几乎所有的例子都是基于Mysql的,Oracle的连接本身在Windows平台下就显得比较复杂。这里便长话短说
下面讲下配置过程
一、下载oracle instantclient
下载地址:
下载 instantclient-basic-windows.x64-11.2.0.4.0
解压路径:D:\Program Files (x86)\Oracle64Client\instantclient_11_2
*注:客户端需要对应数据库版本。
二、配置系统环境变量
在PATH环境变量后加入:;D:\Program Files (x86)\Oracle64Client\instantclient_11_2
三、配置PHP支持OCI扩展
修改配置文件php.ini
开启配置如下
四、重启Apache服务测试
使用探针函数phpinfo()查看扩展是否开启,如果出现下图说明扩展开启
五、测试数据库连接
在站点根目录编写oracle.php,我连接的是虚拟机CentOS中的Oralce数据库
代码如下:
"; ocilogoff($conn); } ?>
浏览器地址栏输入
显示Connected Oracle Successd!说明数据库连接成功。
,
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools