Codeigniter和oracle未定义常量:OCI_COMMIT_ON_SUCCESS [英] Codeigniter and oracle undefined constant: OCI_COMMIT_ON_SUCCESS

查看:844
本文介绍了Codeigniter和oracle未定义常量:OCI_COMMIT_ON_SUCCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用codeigniter开发一个基于Web的应用程序,当我尝试连接到我的oracle企业9g数据库框架给我这个错误:

I develloping a web-based application with codeigniter and when I try to connect to my oracle entreprise 9g database the framework send me this error:

    A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS'

Filename: database/DB.php

Line Number: 142

方法(经典, oracle特定)。
有我的config / database.php文件。

I tried different method to connect (classic, oracle specific). There is my config/database.php file.

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*xxx.xxx.xxx.xxx*)(PORT=1521))(CONNECT_DATA=(SID=*DB_NAME*)))';
$db['default']['username'] = '*username*';
$db['default']['password'] = '*password*';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'oci8';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

我认为这不是连接错误,你能帮我吗?

I think it's not a connection error, can you help me?

推荐答案

OCI_COMMIT_ON_SUCCESS 是在Oracle PHP 扩展。您确定您已正确安装吗?它是否在php.ini中启用?您能否确认可以使用 oci_connect

OCI_COMMIT_ON_SUCCESS is a constant declared in the Oracle PHP extension. Are you sure you have that installed correctly? Is it enabled in php.ini? Can you confirm that you can connect to the database manually with oci_connect?

如果您没有扩展程序,则需要安装。有一个列表,我通常采取的调试安装这里

If you don't have the extension, then you'll need to install it. There is a list of steps I generally take to debug the installation here.

我不知道OCI_COMMIT_ON_SUCCESS的值是什么,但你可能可以自己定义,如果它涉及到。

I'm not sure what the value of OCI_COMMIT_ON_SUCCESS is, but you might be able to fake it with your own define, if it comes to that.

这篇关于Codeigniter和oracle未定义常量:OCI_COMMIT_ON_SUCCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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