PHP解释器使用ADODB获取未定义的常量OCI_COMMIT_ON_SUCCESS [英] PHP interpreter gets undefined constant OCI_COMMIT_ON_SUCCESS with ADODB

查看:172
本文介绍了PHP解释器使用ADODB获取未定义的常量OCI_COMMIT_ON_SUCCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我写了一个必须在php解释器(没有Apache)上运行的php脚本,该解释器将adodb库与Oracle数据库一起使用,但是当我尝试运行它时,出现以下错误:


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:\proyect\backend\libraries\adodb\adodb.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.

提前谢谢!

推荐答案

快速搜索后,我发现了

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆