简体   繁体   English

PHP中的Oracle连接错误。 致命错误:调用未定义函数oci_connect()

[英]Oracle Connection Error in PHP. Fatal error: Call to undefined function oci_connect()

I am working on this project where i need to connect to the Oracle database. 我正在该项目中工作,需要连接到Oracle数据库。 I am using the latest version of WAMP 2.2 and also activated all the extensions related the Oracle in PHP extensions. 我正在使用最新版本的WAMP 2.2,并且还激活了与PHP扩展中的Oracle相关的所有扩展。 I have used following code for the connection to Oracle Database. 我已使用以下代码连接到Oracle数据库。

<?php 

$dbHost = "192.168.0.205";
$dbHostPort="1523";
$dbServiceName = "orcl";
$usr = "system";
$pswd = "admin";
$dbConnStr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
        (HOST=".$dbHost.")(PORT=".$dbHostPort."))
        (CONNECT_DATA=(SERVICE_NAME=".$dbServiceName.")))";

if(!$dbConn = oci_connect($usr,$pswd,'192.168.0.205:1158/em')){
$err = oci_error();
trigger_error('Could not establish a connection: ' . $err['message'], E_USER_ERROR);
}
else
{
echo "COnnected";
}

$strSQL = "SELECT SYSDATE FROM DUAL";

$stmt = oci_parse($dbConn,$strSQL);
if ( ! oci_execute($stmt) ){
$err = oci_error($stmt);
trigger_error('Query failed: ' . $err['message'], E_USER_ERROR);
};

while(oci_fetch($stmt)){
$rslt = oci_result($stmt, 1); print "<h3>query returned: ".$rslt."</h3>";
}
?>

Kindly suggest the error. 请提示错误。 Thanks in advance. 提前致谢。

The OCI8 PHP extension is not available in your PHP installation. OCI8 PHP扩展在您的PHP安装中不可用。 See the manual of the OCI8 PHP extension for installtion instructions. 有关安装说明,请参见OCI8 PHP扩展手册

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP8 + Oracle OCI8 =&gt; 致命错误:未捕获错误:调用未定义的函数 oci_connect() - PHP8 + Oracle OCI8 => Fatal error: Uncaught Error: Call to undefined function oci_connect() 致命错误:调用未定义的函数 oci_connect() php 错误 - Fatal error: Call to undefined function oci_connect() php error 致命错误:调用Wamp中未定义的函数oci_connect() - Fatal error: Call to undefined function oci_connect() in Wamp 致命错误:调用未定义函数oci_connect() - Fatal error: Call to undefined function oci_connect() 无法加载oci8 - &gt;致命错误:调用未定义的函数oci_connect() - can not load oci8 -> Fatal error: Call to undefined function oci_connect() 致命错误:在Windows 10上运行的Oracle 10g中,在Wamp Server 3.0中调用未定义函数oci_connect() - Fatal error: Call to undefined function oci_connect() in wamp server 3.0 with oracle 10g running on windows 10 致命错误:在第3行的C:\\ xampp \\ htdocs \\ Project1 \\ connect.php中调用未定义函数oci_connect() - Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\Project1\connect.php on line 3 致命错误:未捕获错误:通过命令提示符运行php脚本时调用未定义函数oci_connect() - Fatal error: Uncaught Error: Call to undefined function oci_connect() while running the php script through command prompt 致命错误:在第71行的C:\\ xampp81 \\ htdocs \\ aaainc \\ db.php中调用未定义函数oci_connect() - Fatal error: Call to undefined function oci_connect() in C:\xampp81\htdocs\aaainc\db.php on line 71 致命错误:在第75行的C:\\ xampp81 \\ htdocs \\ test \\ inc \\ db.php中调用未定义函数oci_connect() - Fatal error: Call to undefined function oci_connect() in C:\xampp81\htdocs\test\inc\db.php on line 75
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM