windows下php连接Oracle配置

windows下php连接Oracle 11g配置

系统
windows8 server 64

PHP集成环境
Wampserver2.2

步骤
1.配置Oracle client到本机的系统环境

从“http://www.oracle.com/technetwork/topics/winx64soft-089540.html ”
下载64位文件“instantclient-basic-windows.x64-11.2.0.3.0.zip”,并解压到目录,如c:\windows\instantclient_11_2;
将目录“c:\windows\instantclient_11_2”加入到系统环境变量Path中,最好加到最前面

2.重新启动系统

3 .开启php扩展并重启apache
php_oci8_11g
php_pdo_oci //-->如果用pdo连接
查看 输出信息,确认oci8扩展开启

4.用脚本测试链接
oci_connect(your_username, your_password, "localhost/orcl.168.1.2");

注:
1.先配置Oracle的系统环境变量,重启系统,如果先开启php扩展配置会提示oci.dll找不到等错误提示。
2.如果连接提示PATH未配置,重启后也不能解决,请查看用户权限,最好用admin配置,如果还是不行,则直接安装客户端"win64_11gR2_client",(大约600多兆)

猜你喜欢

转载自blog.csdn.net/a460550542/article/details/79915416