在IIS7 windows 2008上连接OCI8 for PHP

时间:2022-10-21 23:59:43

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

我在IIS7,Windows 2008 R2服务器上运行PHP应用程序

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

我尝试连接到远程Oracle数据库,我在IIS7使用网络平台安装程序上安装了PHP,然后启用了以下扩展:php_oci8.dll,php_oci8_11g.dll,php_pdo_oci.dll

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

当我运行phpinfo时,我无法在扩展中找到oci8。

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 个解决方案

#1


0  

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

现在检入php_info();如果启用,则oci8启用与否,然后使用标准的oci8连接

This is your standard Oracle connection

这是您的标准Oracle连接

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.

并祝贺...你结合了3个独立的服务Oracle,Microsoft,PHP。

#1


0  

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

现在检入php_info();如果启用,则oci8启用与否,然后使用标准的oci8连接

This is your standard Oracle connection

这是您的标准Oracle连接

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.

并祝贺...你结合了3个独立的服务Oracle,Microsoft,PHP。