I tried using the directions here:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/macsoft.html
and they did not work at all with PHP. None of the oci_ PHP functions worked. I wrote some new directions which seem to work. They've been tested with several clean installs of OS X and have shown no problems.
Installing PHP with Oracle Instant Client on Mac OS X
This will allow you to use the oci* PHP functions.
James Cho, jamec@umich.edu
Prerequisites
* OS X Xcode Tools (or any working GCC compiler)
* Personal Web Sharing (or any Apache 1.3.x server) and PHP (4.3.x) should be enabled (other versions may require a little modification)
* Basic Terminal Skills
Instructions
NOTE: Replace every "instantclient" mentioned below with the actual name of YOUR instant client folder (such as instantclient_10).
1. Download and unzip the Oracle Instant Client Basic and SDK packages:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/macsoft.html
(Disregard the installation instructions at that page.)
You may have to register on Oracle's website. You may also google "oracle mac os x instant client" if the above link is dead.
2. Move the sdk folder from the SDK zip file into the instantclient folder, and move the instantclient folder into /usr/lib using Terminal.
3. Add the following line to the beginning of the /usr/sbin/apachectl file. Remember to replace "instantclient" with the actual folder name. Leave off the trailing slash after "instantclient." This will properly set the LD_LIBRARY_PATH environment variable upon apache startup.
export LD_LIBRARY_PATH=/usr/lib/instantclient
4. Create the directory structure /b/729/rdbms/lib and copy the file libclntsh.dylib.10.1 from the instantclient folder to the /b/729/rdbms/lib directory.
5. Create a symbolic link as /usr/lib/instantclient/libclntsh.dylib directing to libclntsh.dylib.10.1.
6. Download the PHP source code:
http://us2.php.net/downloads.php
7. Unzip the source file if necessary, then navigate to the PHP directory in Terminal. Configure, build and install PHP as shown. (Remember to replace "instantclient" below with the actual folder name.):
$ tar xvjf php-4.3.x.tar.bz2
$ cd php-4.3.x
$ sudo bash
# ./configure --with-apxs=/usr/sbin/apxs --with-oci8-instant-client=/usr/lib/instantclient
# make
# make install
If "make" returns errors, ensure that the LD_LIBRARY_PATH is set with no trailing slash, and that your "configure" command was correct.
PHP with the Oracle Client Libraries should now be installed. Stop and start apache (apachectl restart will not suffice) if necessary.
Message was edited by:
user448198
Message was edited by:
user448198
Message was edited by:
user448198