Connection OCI8 for PHP on IIS7 windows 2008

独自空忆成欢 提交于 2019-12-14 02:29:05

问题


I have PHP application running on IIS7, windows 2008 R2 server

i try to connect to remote Oracle DB, i installed PHP on the IIS7 useing web platform installer, then enabled the following extension : php_oci8.dll, php_oci8_11g.dll, php_pdo_oci.dll

when i run phpinfo i can't find oci8 enabled in the extensions.

this is my function to connect

<?php

function oci_query_assoc($oconn,$query){
$result = oci_parse($query);
oci_execute($oconn,$result);
while($row = oci_fetch_assoc($result)){
$return[] = $row;
}
return $return;
}

function oci_query_assoc_single($oconn,$query){
$result = oci_parse($query);
oci_execute($oconn,$result);
while($row = oci_fetch_assoc($result)){
$return = $row;
}
return $return;
}

?>

回答1:


Now check in php_info(); that oci8 enables or not if enable then use standard oci8 connections

This is your standard Oracle connection

include('database.php'); //which have database credentials and server name stored

  $c = oci_connect($userName, $password, "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =$serverName)(PORT = 1521)))(CONNECT_DATA=(SID=$databaseName)))");

print_r($c);

and let me know wether it is work or not

and congrats... you combined 3 separate services Oracle, Microsoft, PHP.



来源:https://stackoverflow.com/questions/21522505/connection-oci8-for-php-on-iis7-windows-2008

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!