doujun5009 2018-12-06 11:35
浏览 69

无法使用PHP与XAMPP连接到Oracle Database 11g

Installed XAMMP and PHP 5.6.31 using Oracle instaclient_11_2 already in the C:\drive. Edited and enabled extension=php_oci8_11g.dll in php.ini. Installed php_oci8_11g.dll in C:\xampp\php\ext.

What did i miss?

PHP returns:

Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\OC\oci8.php on line 3

<?php

$conn = oci_connect('hr', 'hr', 'localhost/orcl');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENTS_QUOTES),E_USER_ERROR);
}
else echo "connection successful";

?> 
  • 写回答

1条回答

  • douyan2821 2018-12-06 12:43
    关注

    I understand that you have enable OCI but enabling OCI can be tricky.

    1. Please closely follow this link:

      https://www.oracle.com/technetwork/articles/dsl/technote-php-instant-12c-2088811.html

    2. Please see dll for OCI match php , that is 64bit php , 64bit OCI DLL, or 32bit php and 32bit OCI

    3. Try copying php_oci8_xx.dll to system32. and restart pc. (not recommended but just to avoid the path issue, but first thing first make sure you follow above link carefully)

    Thank you

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP