PHP interpreter gets undefined constant OCI_COMMIT_ON_SUCCESS with ADODB


I wrote a PHP script that should be run on a PHP interpreter (without Apache) that uses the adodb library with an Oracle database, but when I try to run it, I get 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 checked and enabled both php_oci8 and php_oci8_11g, so the constant SHOULD be defined. Also, when I run this script WITH Apache, it works without problems.

Thanks in advance!

+4
source share
2 answers

After a quick search, I found this page . If you do not have the oracle extension in your php.ini, then the constant is undefined. Try to find 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 resetting php.ini variables by doing something like print_r(ini_get_all()) and looking at what is installed and what is not. You can use another php.ini for the command line.

+8
source

I had problems with wamp using 32bit and 64bit. I had to use the 32-bit Oracle thin client with the 32-bit Wamp server for it to work correctly.

+1
source

Source: https://habr.com/ru/post/1403519/


All Articles