在IIS7 Windows 2008上为PHP连接OCI8 [英] Connection OCI8 for PHP on IIS7 windows 2008
问题描述
我有在IIS7,Windows 2008 R2服务器上运行的PHP应用程序
I have PHP application running on IIS7, windows 2008 R2 server
我尝试连接到远程Oracle DB,我使用Web平台安装程序在IIS7上安装了PHP,然后启用了以下扩展名: php_oci8.dll,php_oci8_11g.dll,php_pdo_oci.dll
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
当我运行phpinfo时,在扩展中找不到启用的oci8.
when i run phpinfo i can't find oci8 enabled in the extensions.
这是我的连接功能
<?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;
}
?>
推荐答案
现在检查php_info(); oci8是否启用,如果启用,则使用标准oci8连接
Now check in php_info(); that oci8 enables or not if enable then use standard oci8 connections
这是您的标准Oracle连接
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);
让我知道它是否有效
并恭喜...您将Oracle,Microsoft,PHP的3个独立服务组合在一起.
and congrats... you combined 3 separate services Oracle, Microsoft, PHP.
这篇关于在IIS7 Windows 2008上为PHP连接OCI8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!