dongshi1868 2014-02-03 08:18
浏览 46

在IIS7 windows 2008上连接OCI8 for PHP

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条回答 默认 最新

  • dongliao1948 2014-07-17 06:24
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探