1. <i id='uY7bO'><tr id='uY7bO'><dt id='uY7bO'><q id='uY7bO'><span id='uY7bO'><b id='uY7bO'><form id='uY7bO'><ins id='uY7bO'></ins><ul id='uY7bO'></ul><sub id='uY7bO'></sub></form><legend id='uY7bO'></legend><bdo id='uY7bO'><pre id='uY7bO'><center id='uY7bO'></center></pre></bdo></b><th id='uY7bO'></th></span></q></dt></tr></i><div id='uY7bO'><tfoot id='uY7bO'></tfoot><dl id='uY7bO'><fieldset id='uY7bO'></fieldset></dl></div>
    2. <tfoot id='uY7bO'></tfoot>
          <bdo id='uY7bO'></bdo><ul id='uY7bO'></ul>
        <legend id='uY7bO'><style id='uY7bO'><dir id='uY7bO'><q id='uY7bO'></q></dir></style></legend>
      1. <small id='uY7bO'></small><noframes id='uY7bO'>

      2. 调用未定义的函数 oci_connect、php_oci8_12c.dll、windows 8.1、php5.6.6

        Call to undefined function oci_connect, php_oci8_12c.dll, windows 8.1, php5.6.6(调用未定义的函数 oci_connect、php_oci8_12c.dll、windows 8.1、php5.6.6)

            <bdo id='QITfz'></bdo><ul id='QITfz'></ul>
              <tbody id='QITfz'></tbody>
            <i id='QITfz'><tr id='QITfz'><dt id='QITfz'><q id='QITfz'><span id='QITfz'><b id='QITfz'><form id='QITfz'><ins id='QITfz'></ins><ul id='QITfz'></ul><sub id='QITfz'></sub></form><legend id='QITfz'></legend><bdo id='QITfz'><pre id='QITfz'><center id='QITfz'></center></pre></bdo></b><th id='QITfz'></th></span></q></dt></tr></i><div id='QITfz'><tfoot id='QITfz'></tfoot><dl id='QITfz'><fieldset id='QITfz'></fieldset></dl></div>

            <legend id='QITfz'><style id='QITfz'><dir id='QITfz'><q id='QITfz'></q></dir></style></legend>
            <tfoot id='QITfz'></tfoot>
            • <small id='QITfz'></small><noframes id='QITfz'>

                1. 本文介绍了调用未定义的函数 oci_connect、php_oci8_12c.dll、windows 8.1、php5.6.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个简单的 php 脚本:

                  I have a simple php script:

                  <?php
                  $db_user = 'myusername';
                  $db_pass = 'mypassword';
                  $db_sid = 'mysid';
                  $conn = oci_connect( $db_user, $db_pass, $db_sid );
                  ?>
                  

                  当我运行它时(从浏览器或命令行),我收到错误:

                  When I run it (from a browser or from the command line), I get the error:

                  Call to undefined function oci_connect
                  

                  我正在使用 php_oci8_12c.dll 附带的 php 5.6.6.

                  I'm using php 5.6.6 which came with php_oci8_12c.dll already there.

                  我的 php.ini 中有 extension=php_oci8_12c.dll

                  I have extension=php_oci8_12c.dll in my php.ini

                  我已经安装了 Instant Client (12.1) - 尝试了 32 位版本和 64 位版本

                  I have installed instant client (12.1) - tried 32 bit version AND 64 bit version

                  我有指向即时客户端文件夹 ( C:instantclient_12_1 ) 的 ORACLE_HOME 和 TNS_ADMIN 环境变量.

                  I have ORACLE_HOME and TNS_ADMIN environment variables pointing at the instant client folder ( C:instantclient_12_1 ).

                  我的路径中也有 C:instantclient_12_1

                  I also have C:instantclient_12_1 in my path

                  我在同一个文件夹中有一个 tnsnames.ora,其中包含此相关条目:

                  I have a tnsnames.ora in that same folder with this relevant entry in it:

                  MYSID =
                    (DESCRIPTION =
                      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.net)(PORT = 1521))
                      (CONNECT_DATA =
                        (SERVER = DEDICATED)
                        (SERVICE_NAME = MYSERVICE)
                      )
                    )
                  

                  我还从 http://下载了 SQLDeveloperwww.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html

                  SQLDeveloper 工作,识别上面提到的 tnsnames.ora 并连接并成功地在我的 php 脚本试图访问的同一个数据库上运行查询.

                  SQLDeveloper works, recognizes the above mentioned tnsnames.ora and connects and successfully runs a query on the same database that my php script is trying to access.

                  几天来,我花了几个小时尝试不同的事情,但都无济于事.

                  I have spent several hours over several days trying different things to no avail.

                  我正在使用:

                  php 5.6.6
                  windows 8.1
                  IIS (so no answers involving apache please)
                  cmd (run as administrator)
                  Oracle Database 11g Enterprise Edition 11.2.0.3.0 
                  

                  其他一些可能有用的信息:

                  Some other information that might prove useful:

                  理想情况下,我希望使用 oci 1.4.10 来匹配生产服务器,但现在不太担心.

                  I would ideally like to use oci 1.4.10 to match the production server, but not too worried about that for now.

                  pear install oci8-1.4.10.tgz
                  

                  给我这个错误:

                  The DSP oci8.dsp does not exist
                  

                  我找不到任何对我有意义的错误的解释.

                  I can't find any explanation on that error that means anything to me.

                  我错过了什么 - 谁能帮帮我

                  What am I missing - can anyone help me

                  我已经尝试了其他关于 stackoverflow 的帖子中的各种建议,即:

                  I have tried the various suggestions in other posts on stackoverflow, namely:

                  extension=oci8.so 有和没有 extension=php_oci8_12c.dll

                  我的 php.ini 文件中没有 extension=php_oracle.dll

                  I don't have the line extension=php_oracle.dll in my php.ini file

                  phpinfo 告诉我我使用的是正确的 php.ini 文件:

                  phpinfo tells me that I am using the correct php.ini file:

                  Loaded Configuration File => C:php5.6.6php.ini
                  

                  phpinfo 中的这一行也可能有用:

                  This line from phpinfo might also be of use:

                  Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=c:php-sdkoraclex86instantclient_12_1sdk,shared" "--with-oci8-12c=c:php-sdkoraclex86instantclient_12_1sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"
                  

                  似乎 dsp 文件是 VC++ 项目文件 - 我现在正在冒险学习如何创建 php 扩展,希望当我完成后我将有足够的知识将 oci8 1.4.10 源代码编译成一个适用于 Windows 8 的 dll - 除非有人用这个问题的答案来拯救我 - 这看起来需要我一些时间:-)

                  It seems that dsp files are VC++ project files - I am now venturing on learning how to create a php extension, and hopefully when I've done that I'll have enough knowledge to compile the oci8 1.4.10 source code into a dll that works on windows 8 - unless somebody rescues me with the answer to this question - this looks like it is going to take me some time :-)

                  向 php.ini 添加 display_startup_errors = On 告诉我 oci dll 不是有效的 Win32 应用程序

                  Adding display_startup_errors = On to php.ini tells me that the oci dll is not a valid Win32 application

                  推荐答案

                  嗯.在 Windows 8 上尝试此操作似乎会生成与您指定的相同的错误.我目前正在调查...

                  我的错误(我启用了错误的 extension_dir 行).它在 Win8 中的工作原理如下所述.

                  My mistake (I had enabled the wrong extension_dir line). It works in Win8 just as documented below.

                  以下步骤应该是让 OCI 使用 PHP 所需的全部步骤(我刚刚在新安装的 Windows 2008 R2 Standard x64 虚拟机上验证了这一点):

                  The following steps should be all you need to get OCI working with PHP (I've just verified this on a freshly installed Windows 2008 R2 Standard x64 virtual machine):

                  • 下载并提取 PHP(我使用了 php-5.6.7-nts-Win32-VC11-x86.zip 中的 C:php).
                  • 下载并提取 InstantClient(我使用了 instantclient-basic-nt-12.1.0.2.0.zip 中的 C:instantclient_12_1).
                  • 将上述路径添加到系统路径中.
                  • c:phpphp.ini-production复制到c:phpphp.ini.
                  • php.ini中:
                    • 启用行 extension_dir = "ext".
                    • 启用行extension=php_oci8_12c.dll.
                    • Download and extract PHP (I used C:php from php-5.6.7-nts-Win32-VC11-x86.zip).
                    • Download and extract InstantClient (I used C:instantclient_12_1 from instantclient-basic-nt-12.1.0.2.0.zip).
                    • Add the above paths to the system path.
                    • Copy c:phpphp.ini-production to c:phpphp.ini.
                    • in php.ini:
                      • enabled line extension_dir = "ext".
                      • enabled line extension=php_oci8_12c.dll.

                      此时在命令提示符中运行 php --ri oci8 会显示以下输出:

                      At this point running php --ri oci8 in a command prompt shows me the following output:

                      C:>php --ri oci8
                      
                      oci8
                      
                      OCI8 Support => enabled
                      OCI8 DTrace Support => disabled
                      OCI8 Version => 2.0.9
                      Revision => $Id: f5a3ee1083d1ffa6adb5143efda6eafa210b8414 $
                      Oracle Run-time Client Library Version => 12.1.0.2.0
                      Oracle Compile-time Instant Client Version => 12.1
                      
                      Directive => Local Value => Master Value
                      oci8.max_persistent => -1 => -1
                      oci8.persistent_timeout => -1 => -1
                      oci8.ping_interval => 60 => 60
                      oci8.privileged_connect => Off => Off
                      oci8.statement_cache_size => 20 => 20
                      oci8.default_prefetch => 100 => 100
                      oci8.old_oci_close_semantics => Off => Off
                      oci8.connection_class => no value => no value
                      oci8.events => Off => Off
                      
                      Statistics =>
                      Active Persistent Connections => 0
                      Active Connections => 0
                      

                      并检查 oci_connect 函数:

                      C:>php -r "var_dump(function_exists('oci_connect'));"
                      bool(true)
                      

                      这篇关于调用未定义的函数 oci_connect、php_oci8_12c.dll、windows 8.1、php5.6.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                      本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    • <legend id='9TO9e'><style id='9TO9e'><dir id='9TO9e'><q id='9TO9e'></q></dir></style></legend>
                        <tbody id='9TO9e'></tbody>

                        <tfoot id='9TO9e'></tfoot>
                        <i id='9TO9e'><tr id='9TO9e'><dt id='9TO9e'><q id='9TO9e'><span id='9TO9e'><b id='9TO9e'><form id='9TO9e'><ins id='9TO9e'></ins><ul id='9TO9e'></ul><sub id='9TO9e'></sub></form><legend id='9TO9e'></legend><bdo id='9TO9e'><pre id='9TO9e'><center id='9TO9e'></center></pre></bdo></b><th id='9TO9e'></th></span></q></dt></tr></i><div id='9TO9e'><tfoot id='9TO9e'></tfoot><dl id='9TO9e'><fieldset id='9TO9e'></fieldset></dl></div>
                            <bdo id='9TO9e'></bdo><ul id='9TO9e'></ul>
                          • <small id='9TO9e'></small><noframes id='9TO9e'>