doukuiqian9911 2016-08-01 22:22
浏览 838
已采纳

php_oci8_11g.dll不是有效的Win32应用程序

This topic has been asked several times, but every solution is not working in my machine.

I am trying to connect windows 7 with a 10G oracle dabatase, but the oci extension is not loaded. Here some facts:

C:\php>php -m

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_oci8_11g.dll' - %1 is not a valid Win32 application.

C:\php>php -v

PHP 5.6.19 (cli) (built: Mar  2 2016 20:09:42)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
  • 64x architecture
  • TS VC11

C:\>tnsping localdb

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 02-AUG-2
016 22:37:50

Troubleshooting

  • I am using oci8 2.0.11. Dropped them in ext/ folded. The rest of extesions are loaded pretty good.
  • PATH variable contains the ORACLE_HOME and php path
  • Just looked up for required oracle dll files and they are there:

    C:\>where oci*

    C:\oracle\product\10.2.0\db_2\BIN\oci.dll
    C:\oracle\product\10.2.0\db_2\BIN\ocijdbc10.dll
    C:\oracle\product\10.2.0\db_2\BIN\ociw32.dll
    
  • Oracle Client is not required in my side because the database is installed in the same machine, and it install all the required libraries

What other thing am I missing? Thank you in advance

  • 写回答

2条回答 默认 最新

  • doufu2496 2016-11-04 20:44
    关注

    After months I found the solution. Consider the following infrastructure:

    • Windows Server 2012 R2 Standard Edition x64
    • Apache/2.4.18 (Win64) VC11
    • PHP 5.6.19 x86 VC11 TS

    Take close attention when downloading Oracle Instant Client:

    • No matter if your server is x64 or x86 arquitecture, you must download it for 32-bits
    • As you note, PHP is compiled in VC11, so you must download OIC with VC11 sources, this can be confirmed unzipping the downloaded file and check if a folder vc11 is there.

    Both details are very important. Once I meet both requirements the error has gone I now I am able to connect to Oracle via PHP successfully

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 模拟电路求复阻抗和传递函数,请各位拍照写一下解答过程
  • ¥60 不懂得怎么运行下载来的代码
  • ¥15 CST导出3D模型图为什么和软件显示不一样?
  • ¥15 加热反应炉PLC控制系统设计(相关搜索:梯形图)
  • ¥15 python 用Dorc包报错,我的写法和网上教的是一样的但是它显示无效参数,是什么问题
  • ¥15 经过滑动平均后的一维信号还原用什么结构好呢?
  • ¥15 指定IP电脑的访问设置
  • ¥30 matlab ode45 未发现警告,但是运行出错
  • ¥15 为什么devc++编译项目会失败啊
  • ¥15 vscode platformio