我正在开发一个连接到Oracle数据库的PHP,但不幸的是,该连接无法工作。首先,我实现了开发环境(oracle数据库服务器+ apache服务器),我猜都配置得很好。问题是,即使我输入了不正确的数据,也无法从我编写的代码中得到任何响应。
oci8:
[rvieira@localhost ~]$ php --ri oci8
oci8
OCI8 Support => enabled
Version => 1.4.10
Revision => $Id: 44bfa713983a99b3e59477f6532e5fb51b6dee94 $
Active Persistent Connections => 0
Active Connections => 0
Oracle Run-time Client Library Version => 11.2.0.2.0
Oracle Instant Client Version => 11.2
Temporary Lob support => enabled
Collections support => enabled
Directive => Local Value => Master Value
oci8.max_persistent => -1 => -1
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
oci8.default_prefetch => 100 => 100
oci8.old_oci_close_semantics => Off => Off
oci8.connection_class => no value => no value
oci8.events => Off => OffPHP代码:
<?php
$connection = oci_connect('sys', 'rvieira', 'localhost/xe');
if (!$connection) {
$m = oci_error();
echo $m['message'], "\n";
exit;
}
else {
print "Connected to Oracle!";
}
?>我还在这里留下了配置开发环境所遵循的教程:
发布于 2013-10-13 23:47:11
您的错误消息表明,环境变量LD_LIBRARY_PATH存在问题,但没有详细说明具体内容。在“在Linux上启用PHP扩展”的步骤6中介绍了此设置,您可以在OCI8上找到该扩展。
再检查一下你的安装--你可能漏掉了什么。
https://stackoverflow.com/questions/19350742
复制相似问题