PHP interpreter gets undefined constant OCI_COMMIT_ON_SUCCESS with ADODB(PHP 解释器使用 ADODB 获取未定义的常量 OCI_COMMIT_ON_SUCCESS)
问题描述
我写了一个必须在 php 解释器(没有 Apache)上运行的 php 脚本,它使用带有 Oracle 数据库的 adodb 库,但是当我尝试运行它时,出现以下错误:
I wrote a php script that must be run on the php interpreter (Without Apache), which uses the adodb library with an Oracle database, but when I try to run it, I'm getting the following error:
PHP Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in c:proyectackendlibrariesadodbadodb.inc.php on line 4248
我已经检查过,并且启用了 php_oci8 和 php_oci8_11g,因此应该定义常量.此外,当我使用 Apache 运行此脚本时,它可以正常工作.
I've checked, and have both the php_oci8 and php_oci8_11g enabled, so the constant SHOULD be defined. Also, when I run this script WITH Apache, it works without any problems.
提前致谢!
推荐答案
经过快速搜索,我找到了 本页.如果您的 php.ini 中没有启用 oracle 扩展,则该常量未定义.尝试搜索该行
After a quick search I found this page. If you don't have the oracle extension enabled in your php.ini then the constant is undefined. Try searching for the line
;extension=php_oci8.dll
在你的 php.ini 中删除分号以取消注释.然后重启Apache加载模块,看是否连接.
in your php.ini and remove the semicolon to uncomment it. Then, restart Apache to load the module and see if it connects.
尝试通过执行诸如 print_r(ini_get_all())
之类的操作来转储 php.ini 变量,然后查看已设置和未设置的内容.您可能在命令行中使用了不同的 php.ini.
Try dumping the php.ini variables by doing something like print_r(ini_get_all())
and see what is set and what isn't. You may be using a different php.ini for the command line.
这篇关于PHP 解释器使用 ADODB 获取未定义的常量 OCI_COMMIT_ON_SUCCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP 解释器使用 ADODB 获取未定义的常量 OCI_COMMIT_ON_SUCCESS


- PHP foreach() 与数组中的数组? 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- PHP - if 语句中的倒序 2021-01-01