dqvzfp6468 2018-10-22 13:49
浏览 129
已采纳

为什么PHP看不到扩展dll文件?

I am little bit confused with strange behavior of PHP and need advice how to fix it.

I am tring to test pretty simple php script:

$conn = oci_connect($dbUser, $dbPassword, $dbServerName . "/" . $dbName);
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message']), E_USER_ERROR);
}

Unfortunatly it raise me next ERROR:

[22-Oct-2018 19:22:23] PHP Warning:  PHP Startup: Unable to load dynamic library 'F:\PHP_x64\ext\php_oci8_12c.dll' - The specified procedure could not be found.
 in Unknown on line 0
[22-Oct-2018 19:22:23] PHP Fatal error:  Call to undefined function oci_connect() in F:\TEST\complain\test.php on line 8

I have project which is located in IIS web server. Project use PHP Version 5.6.28.

enter image description here

Inside F:\PHP_x64\ext\ folder I have file php_oci8_12c.dll as you can see below: enter image description here

Inside php.ini file I have uncommented line:

extension=php_oci8_12c.dll

Also in php.ini file I add:

extension_dir = "F:\PHP_x64\ext\"
[PHP_OCI8_12C]
extension=php_oci8_12c.dll

I restart IIS web server several times.

When I try to call php.exe from console it show me next error:

enter image description here

  • 写回答

1条回答 默认 最新

  • doujie4787 2018-10-25 07:27
    关注

    Finally I found solution which work for me.

    The code which I use to connect PHP with Oracle:

    $conn = oci_connect($dbUser, $dbPassword, "(DESCRIPTION=(ADDRESS_LIST =(ADDRESS=(PROTOCOL = TCP)(HOST=$dbServerName)(PORT = 1521)))(CONNECT_DATA=(SID=$dbSID)))", 'AL32UTF8') or die("Could not connect to ORACLE");
    

    In my case I used SID, you can also use SERVICE_NAME.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB代码补全插值
  • ¥15 Typegoose 中如何使用 arrayFilters 筛选并更新深度嵌套的子文档数组信息
  • ¥15 前后端分离的学习疑问?
  • ¥15 stata实证代码答疑
  • ¥50 husky+jaco2实现在gazebo与rviz中联合仿真
  • ¥15 dpabi预处理报错:Error using y_ExtractROISignal (line 251)
  • ¥15 在虚拟机中配置flume,无法将slave1节点的文件采集到master节点中
  • ¥15 husky+kinova jaco2 仿真
  • ¥15 zigbee终端设备入网失败
  • ¥15 金融监管系统怎么对7+4机构进行监管的