且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在IIS7 Windows 2008上为PHP连接OCI8

更新时间:2023-01-10 21:29:30

现在检查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.