how to enable Oracle (oci8) on PHP

12 posts / 0 new
Last post
#1 Mon, 05/25/2009 - 19:05
rogeriobrito

how to enable Oracle (oci8) on PHP

Hello all.

How can I enable oracle (oci8) on PHP? I'm using: Operating system CentOS Linux 5.3 Webmin version 1.470
Virtualmin version 3.69.gpl GPL And I have already installed Oracle XE.

Thanks for any help. Rogerio<br><br>Post edited by: rogeriobrito, at: 2009/05/25 19:10

Tue, 05/26/2009 - 10:55
rogeriobrito

Would it work if I run &quot;yum uninstall php&quot;, and then install Zend Core for Oracle?

Thank you for any suggestion.

Rogerio.

Tue, 05/26/2009 - 10:58 (Reply to #2)
Joe
Joe's picture

I have no idea. Is that what the Zend Core for Oracle instructions tell you to do?

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:56 (Reply to #3)
rogeriobrito

The documentation doesn't mention anything about a PHP already installed&acirc;

Sun, 06/07/2009 - 07:56 (Reply to #4)
rogeriobrito

The documentation doesn't mention anything about a PHP already installed&acirc;

Sun, 06/07/2009 - 07:56 (Reply to #5)
rogeriobrito

The documentation doesn't mention anything about a PHP already installed&acirc;

Tue, 05/26/2009 - 20:06 (Reply to #6)
rogeriobrito

Ok guys, I'll do some tests and I will post the results here in a few days.

Thank you very much
Rogerio

Sun, 06/07/2009 - 07:56 (Reply to #7)
rogeriobrito

I got it working!

Here is what I did to make PHP with Oracle XE work in a fresh install of Virtualmin on CentOS 5.3:

<b>- Installed Oracle XE </b>
the line &quot;XXX.XXX.XXX.XXX hostname hostname.domain&quot; must exists in the file /etc/hosts , otherwise installation fails (not giving any error message). The XXXs must be your server IP.
<b>
- updated PHP to 5.2.6 using utterramblings yum repository. </b>
[url]http://www.jasonlitka.com/yum-repository/ [/url]

<b>installed OCI8 extension using pear:</b>
[code:1]yum install php-pear
yum install php-devel
yum install httpd-devel
pear install pecl/oci8 [/code:1]

<b>setup PHP to load the extension:</b>
[code:1]echo &quot;extension=oci8.so&quot; &gt; /etc/php.d/oci8.ini[/code:1]

<b>setup Oracle Environment variables to the apache user, adding the following lines to the file /etc/sysconfig/httpd</b>
[code:1]...
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252[/code:1]

<b>Restart the server</b>
That&acirc;

Tue, 05/26/2009 - 15:11
Joe
Joe's picture

Again, I have no idea. I have never seen Zend Core for Oracle. Never even heard of it. You're asking me about things that I have no idea about.

Is Zend Core for Oracle provided as RPM packages? And do they conflict with the existing PHP packages? Is that why you're asking this question? I don't know what problem you're trying to solve here...you've just asked me if you should uninstall PHP, and the answer is still, &quot;I don't know.&quot;

--

Check out the forum guidelines!

Tue, 05/26/2009 - 17:40
rogeriobrito

Hello Joe.

Zend Core for Oracle was just a suggestion.

I just want to know how do I enabled the oci8 extension on PHP on a Virtualmin box.

Thank you

Tue, 05/26/2009 - 17:51 (Reply to #10)
andreychek

Yeah, I guess the problem is that we haven't done it before :-)

There are instructions on the PHP.net website in the Oracle section there for one way to get it running -- it includes installing some Oracle runtime libraries, as well as compiling PHP from source.

Ideally, what you'd do is modify an existing PHP RPM file to incorporate the Oracle module.

That way, if something doesn't go as you want, no problem, just uninstall the new PHP RPM, install the old one.

Sorry I can't offer more details, but I just haven't needed to install PHP's Oracle support before.
-Eric

Tue, 05/26/2009 - 19:27 (Reply to #11)
Joe
Joe's picture

<div class='quote'>I just want to know how do I enabled the oci8 extension on PHP on a Virtualmin box. </div>

This looks like the right place to start:

http://oss.oracle.com/projects/php/

I don't know how good the Oracle PHP packages are, but since the Oracle Linux variant is a RHEL clone, it seems likely that their packages will be pretty sane. So, I'd suggest you start with their PHP RPMs and work from there to deal with any other issues that crop up.

--

Check out the forum guidelines!

Topic locked