在Windows x64中从php连接到oracle数据库
我正在尝试从 php 连接到 windows x64 中的 oracle 数据库
我使用: php5、apache2、oraclexe 10.2
我的文件“test.php”如下:
<?php
if ($c = oci_connect("SYSTEM", "root", "//localhost:1521/XE")) {
echo "Successfully connected to Oracle.";
oci_close($c);
} else {
$err = oci_error();
echo "Oracle Connect Error " . $err['text'];
}
?>
当我打开 localhost/test.php 时,出现以下错误:
Warning: oci_connect() [function.oci-connect]: ORA-06413: Connection not open
我不能理解这个错误的原因,因为我已经从Java连接到同一个数据库,并且我认为php.ini文件配置得很好,因为我设法从php连接到MySQL数据库。 还遵循了本教程: http://www.orafaq.com/wiki/PHP_FAQ
所以如果有人有解决方案和评论请发布
I am trying to connect from php to oracle database in windows x64
I use: php5, apache2, oraclexe 10.2
My file "test.php" is the following:
<?php
if ($c = oci_connect("SYSTEM", "root", "//localhost:1521/XE")) {
echo "Successfully connected to Oracle.";
oci_close($c);
} else {
$err = oci_error();
echo "Oracle Connect Error " . $err['text'];
}
?>
When I open localhost/test.php, getting a following error:
Warning: oci_connect() [function.oci-connect]: ORA-06413: Connection not open
I can not understand the cause of this error, because I have already connected to the same database from Java, and I think the php.ini file is well configured, because I managed to connect from php to MySQL database.
Also followed this tutorial: http://www.orafaq.com/wiki/PHP_FAQ
So if someone have a solutions and comments post it please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XE是你数据库的服务名吗?这是您必须更改的示例代码中使用的名称。
Is XE the service name of your database? That's the name used in the example code that you have to change.