Jim Morrison wrote:
Hope this isn't an FAQ - have trawled google, otn.oracle, php.net etc - not sure I can find the answer..
I've been using php&mySql for a while now and getting on great - however I'm now tasked with getting my php to talk to a _remote_ ( right next to me but separate ) Oracle server...
I found on otn.oracle.com a thing called 'instantclient' - a couple of
.rpm's to install what is supposed to be a kinda plug-and-play Linux
However, I can't seem to be able to compile PHP with Oracle support, because I don't think instantclient has the required header files to compile PHP/OCI8 .. Is that right?
The other solution I thought might be to use instantclient itself.. ..
It comes with a couple of .so's, so I've tried DynamicallyLoading them
at the top of a php page.. It seems to be loading the one I give it
(libociei.so) but then complains that it can't find "libclntsh.so.10.1"
which I have, and is sitting right next to "libociei.so" ..
( The error is :
Warning: dl(): Unable to load dynamic library '/usr/local/lib/php/extensions/libociei.so' - libclntsh.so.10.1: cannot open shared object file: No such file or directory in /path/to/info.php on line 2
.. And /usr/local/lib/php/extensions/libclntsh.so.10.1 does exist )
Thought that maybe I've just got a path problem..??
Anyway - is the 'ONLY' solution to getting PHP to connect remotely to an
Oracle server to download 1.5Gb's of Oracle CD's?
Has anyone had any experience getting instantclient/php to work? Is
there any way I can get the headers I need to compile --with-oci8
without the 1.5Gb download??
The download of the traditional Client Release is under 400M.
Am I missing something blatantly obvious?
Any advice/points-in-the-right-direction would be much appreciated,
What exactly have you configured? Do you have LD_LIBRARY_PATH set?
I'm using Instant Client with PHP on Linux and a pre-release Instant Client on Windows. I'm starting to put together some notes for http://otn.oracle.com/tech/opensource/index.html
Instant Client doesn't yet come with headers for compiling (the statement I've read is that an SDK is "under investigation"). To get the headers I chose the Administrator install option in the "Oracle Database 10g Client Release 1 (10.1.0.2) for Linux x86" release. I compiled PHP with this first.
I then reran the same installer and chose the Instant Client option. This installed into non-system directories (unlike the Instant Client RPM from OTN). I configured PHP to use Instant Client by setting LD_LIBRARY_PATH to the new library directory, and unsetting ORACLE_HOME before starting Apache.
For PHP you only need libociei.so, libnnz10.so and libclnts.so.10.1 from the Instant Client package. If re-compiling won't be needed, you can copy these libs to a directory of your choice and deinstall Oracle to save disk space.
On Windows you can drop Instant Client straight onto the prebuilt PHP binaries.
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php