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 求差集那个函数有问题,有无佬可以解决
  • ¥15 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名