Running into a problem with the OCI8 extension on Linux. I've installed using the instructions here and here and phpinfo() even reports the library as loading successfully. However, anytime that I attempt to access a page that connects to Oracle I get this error in Apache's error log:
Inconsistency detected by ld.so: dl-minimal.c: 138: realloc: Assertion `ptr == alloc_last_block' failed!
I'm stumped. Any ideas what would cause this and how to fix it? Thanks in advance for any help.
Does SQL*Plus work (install the Instant Client sqlplus package to check)?
From googling, the error seems Debian specific. Even though this is not an officially supported platform, if the error was endemic with Oracle on Debian I would have expected to have seen more search hits.
Triple check everything: correct 32 or 64 bit Instant Client? Permissions? Apache environment? Funky custom compiler & linker flags? Check the version of the OS (not too old, not too new??) Out of memory? Hardware faults?
Thanks for the response. When I attempt to execute SQL*Plus I get this error:
error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
I looked around a bit and it seems that this can be the result of an environment variable not being set, but in this case libsqlplus.so is in one of the directories specified in LD_LIBRARY_PATH (it also happens to be the same directory where sqlplus resides...) Any ideas what I might be doing wrong?
Okay, on to the other items that you listed:
1) correct 32 or 64 bit Instant Client - After your email, I tried a different one. I was using "Instant Client for Linux x86-64" and then double checked the Apache PHP install that I have and tried "Instant Client for Linux AMD64". I initially tried the 64 bit version (the first one listed), and that output the same error; the 32 bit version encountered a compatibility error on install. FYI, here's the Apache/PHP System information from phpinfo():
Linux ims-app02 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64
2) Permissions - I've looked at this carefully, and everything looks okay to me. What are the permissions on the Instant Client items generally supposed to be? (I'm using 755 with the SETGID bit set.)
3) Apache environment - I'm not sure what I'd be looking for here. I am able to access other pages on the site just fine; the problem only happens when the page attempts to access Oracle.
4) Funky custom compiler & linker flags - I don't think so. I'm not using any flags in what I'm doing. Apache and PHP are both installs from packages, rather than compiled by me.
5) Check the version of the OS - It may be an older version. "cat /proc/version" returns:
Linux version 2.6.32-5-amd64 (Debian 2.6.32-41) (email@example.com) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Jan 16 16:22:28 UTC 2012
I'll have to check on Out of Memory and Hardware faults as my access to the system is limited. Also, thanks for the suggestion in your other post about alternate Linux versions, etc. Unfortunately, I have no control of the OS used.
Thanks for your help!
If you don't have access to the machine, is there an administrator you can get help from?
Your error doesn't have many google hits, so it seems to be something specific or subtle.
Get SQL*Plus working first and then replicate that environment for PHP. Make sure to use
SQL*Plus Instant Client that is compatible with the 'basic' Instant Client package.
(And check out the "Commonly Seen Connection and Environment Errors" on p 107
The specific page wasn't the answer, but the attached document was. In short, the problem was that an old version of the library was present, and had not been removed properly. I had received some direction on how to remove it, but there was better (read: more accurate) information in that manual. Thanks!