Oracle support ?

General discussion for the Zend Server CE

Oracle support ?

Postby bretrzaun on Wed Feb 18, 2009 9:58 pm

I am missing the Oracle support.
How do I configure the OCI8 module - it is not in the list of extensions.

btw: I am using the Mac version.
bretrzaun
 
Posts: 2
Joined: Mon Feb 16, 2009 12:02 am

Re: Oracle support ?

Postby shahar on Thu Feb 19, 2009 10:46 am

Hi,

Currently, our Mac package does not include the Oracle extensions. The Oracle Instant Client currently only supports Mac OS X 10.5 and not 10.4, and since we aim to support both of them we decided not to add the Oracle extensions to our Mac packages for now.

Are you using OS X in production or as a development platform?

BTW if you want, the build tools (pecl, php-config, headers etc.) are available for you as part of Zend Server, if you wish to build and add the Oracle extensions yourself. You will need a build environment (gcc, autoconf etc.) and the Oracle Instant Client libraries installed.

Shahar.
shahar
 
Posts: 245
Joined: Mon Oct 06, 2008 12:37 pm
Location: Israel

Re: Oracle support ?

Postby knagurski on Thu Feb 19, 2009 11:23 am

I'm using a Mac too (10.5) and really do need the Oracle support. Could Oracle support not be included and have the installer script disable it when installed on 10.4? You'll probably find that most Mac developers tend to use the latest version of the OS.

I'm not all that experienced with building extensions myself. Would you know how I can go about doing this?

Thanks for your help and really like the rest of the Server!
knagurski
 
Posts: 27
Joined: Thu Feb 19, 2009 11:16 am

Re: Oracle support ?

Postby shahar on Thu Feb 19, 2009 1:17 pm

First of all - thanks for the feedback. We've considered adding Oracle extensions to 10.5 only several months back, and might reconsider if there's enough feedback from users :)

As for installing custom extensions with pecl, we will try to post a guide on that, but I'd start by:

- Making sure you have a compiler (gcc) and build tools (autoconf, automake, etc.). I think that on Mac you can just install Xcode and get them all (but I'm not much of a Mac user, so I'm not sure)
- Install the Oracle Instant Client libraries (you can usually do with the minimal edition but if you need native languages support etc. you might need the more complete package) - see http://www.oracle.com/technology/softwa ... csoft.html for more info
- Once you have everything set up, open a terminal window and run:
Code: Select all
sudo /Applications/ZendServer/bin/pecl install oci8


If all goes well, you should be able to just enable the extension from the UI after doing this. I haven't tried it myself on Mac but I am going to try it later and if there are any changes required I'll post them.
shahar
 
Posts: 245
Joined: Mon Oct 06, 2008 12:37 pm
Location: Israel

Re: Oracle support ?

Postby knagurski on Thu Feb 19, 2009 2:54 pm

Been trying it, but no dice. Downloaded the Intel version of the basic instant client from Oracle, unzipped and put it as /instantclient

Then ran
Code: Select all
sudo /Applications/ZendServer/bin/pecl install oci8

It then asks me for the location of the ORACLE_HOME directory, or type 'instantclient,/path/to', so I enter
Code: Select all
instantclient,/instantclient

But then it fails saying it can find the required libraries.
knagurski
 
Posts: 27
Joined: Thu Feb 19, 2009 11:16 am

Re: Oracle support ?

Postby shahar on Thu Feb 19, 2009 5:59 pm

Hi,

I might have been wrong and you'll need to download the full Oracle Instant Client SDK package (like 10x bigger download). I don't have access to a Mac machine right now - I might have access on Sunday so I'll try to figure this out.
shahar
 
Posts: 245
Joined: Mon Oct 06, 2008 12:37 pm
Location: Israel

Re: Oracle support ?

Postby bretrzaun on Thu Feb 19, 2009 9:23 pm

Without Oracle support Zend Server is useless for us - since Oracle is the primary database we use.

And since Zend Server seemed to promise a cross-plattform php-setup out of the box I thought to give it a try.
Now when I have to build the Oracle module by hand I am back where is was before.

Hopefully you will add Oracle support in future releases.

I will check back then...

PS: I am using MacOSX 10.5
bretrzaun
 
Posts: 2
Joined: Mon Feb 16, 2009 12:02 am

Re: Oracle support ?

Postby knagurski on Fri Feb 20, 2009 10:20 am

shahar wrote:I might have been wrong and you'll need to download the full Oracle Instant Client SDK package (like 10x bigger download). I don't have access to a Mac machine right now - I might have access on Sunday so I'll try to figure this out.


Thanks, I really appreciate it. It would be great to be able to dump the VM that I'm using currently for projects with Oracle.
knagurski
 
Posts: 27
Joined: Thu Feb 19, 2009 11:16 am

Re: Oracle support ?

Postby blackarma2 on Fri Feb 20, 2009 10:37 am

Hi,

I think this will help you : http://www.oracle.com/technology/pub/ar ... opard.html

Regards.
blackarma2
 
Posts: 1
Joined: Fri Feb 20, 2009 10:36 am

Re: Oracle support ?

Postby nickma on Fri Feb 20, 2009 11:57 pm

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.html

2.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.html

3.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
User avatar
nickma
 
Posts: 137
Joined: Mon Dec 29, 2008 5:27 pm

Next

Return to Zend Server Community Edition

Who is online

Users browsing this forum: No registered users and 1 guest