4


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


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.

Thanks in advance!

adiego73
  • 189
  • 1
  • 3
  • 13

2 Answers2

8

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

in your php.ini and remove the semicolon to uncomment it. Then, restart Apache to load the module and see if it connects.

EDIT:

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.

Scott M.
  • 7,313
  • 30
  • 39
  • As my post says, I have both extensions enabled. The problem cames when I tryed to use the interpreter over the console.. – adiego73 Mar 27 '12 at 13:25
  • 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. – Scott M. Mar 27 '12 at 13:31
  • My complete answer :) As my post says, I have both extensions enabled. The problem cames when I use the interpreter over the console.. But, I realized that the php interpreter over the console, was using a different php.ini, so, indeed, the extensions were disabled. Thanks! – adiego73 Mar 27 '12 at 13:34
  • great! I'll update the answer so others can find it more easily. Glad to hear your problem is solved. – Scott M. Mar 27 '12 at 13:49
1

I had issues with wamp using 32-bit and 64-bit. I had to use the 32-bit Oracle thin client with 32-bit wamp server to get it working correctly.

Seb
  • 11
  • 1