Following are the required steps , tested on up to date MacBook.
Thanks to Danilo Vizzarro site for good examples
http://www.danilovizzarro.it/2008/07/ho ... pard-1054/ 1.First requirement is Xcode from Apple site. Xcode installs Unix build tools .Default installation of XCode will take care of the build environment. GCC and the CLI environment variables. To download Xcode free online ADC Membership. If you are already a member, log in with your ADC Member Apple ID and password.
http://developer.apple.com/technology/xcode.html2.Second requirement is Oracle Instant Client Libraries needed for correct compilation of OCI8 extension.You will need to packages:
instantclient-basic-macosx-10.2.0.4.0.zip (34,020,719 bytes)
instantclient-sdk-macosx-10.2.0.4.0.zip (603,493 bytes)
Download from the following page at Oracle website:
http://www.oracle.com/technology/softwa ... csoft.html3.You will have to create directory on you system where Oracle libraries will reside .Unpack previously downloaded OIC and SDK files at this dedicated folder. - Code: Select all
mkdir -p /opt/oracle
cd /opt/oracle
cp /Users/nick/Desktop/instant*.zip /opt/oracle
unzip \*.zip
cd /opt/oracle/instantclient_10_2
You also need to link two files otherwise you will not be able to build the extension.
- Code: Select all
cd /opt/oracle/instantclient_10_2
ln -s libclntsh.dylib.10.1 libclntsh.dylib
ln -s libocci.dylib.10.1 libocci.dylib
4.PECL comes very handy at this point. Download and build the extension using PECL as previously mentioned by Shahar.- Code: Select all
cd /Applications/ZendServer/bin/
sudo ./pecl install oci8
You will be requested to provide path to ORACLE_HOME
- Code: Select all
1. Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client : autodetect
1-1, 'all', 'abort', or Enter to continue:
Type 1 and then provide it with
- Code: Select all
instantclient,/opt/oracle/instantclient_10_2
PECL will take care of all the rest and the oci8.so will be placed at the extension folder.
/Applications/ZendServer/lib/php_extensions
5.Unfortunately I wasn't able to find a way compile OCI8 to be a separate,no library dependant extension. Oracle Client libraries required be located in DYLD_LIBRARY_PATH and oci8 extension will not load without them. If you think about compiling the extension and then moving it to other machine , libraries will have to be installed as well.
6.Final very important issue related to the DYLD_LIBRARY_PATH issue mentioned before.At first Oci8 extension if enabled will prevent Apache from starting and you will get large red error in the GUI."Failed to access Web server. Please make sure that the Web server is running and listening to the correct port"Without going into too many details why oci8.so is linked to external files and why is it preventing Apache from starting .Workaround is to add so called ORACLE_HOME to DYLD_LIBRARY_PATH environment of the Apache server.
Edit in text editor /Applications/ZendServer/apache2/bin/envvars and change
- Code: Select all
DYLD_LIBRARY_PATH="/Applications/ZendServer/apache2/lib:$DYLD_LIBRARY_PATH"
to
- Code: Select all
DYLD_LIBRARY_PATH="/Applications/ZendServer/apache2/lib:/opt/oracle/instantclient_10_2:$DYLD_LIBRARY_PATH"
Stop and Start Apache
- Code: Select all
sudo /Applications/ZendServer/apache2/bin/apachectl stop
- Code: Select all
sudo /Applications/ZendServer/apache2/bin/apachectl start
7.Enable oci8 from Zend Server GUI and check PHPINFO , extension should be loaded and you should be good to connect Oracle Databases