![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
First Cup of Ubuntu
![]() Join Date: Dec 2004
Location: Bonn, Germany
Beans: 2
|
If you want to connect to an Oracle database with PHP, you can use Oracle's Instant Client and the oci8 module from pear.
Download the Basic and the SDK packages from http://www.oracle.com/technology/tec...antclient.html. At the time of this writing, the filenames are instantclient-basic-linux32-10.2.0.1-20050713.zip and instantclient-sdk-linux32-10.2.0.1-20050713.zip. Unzip these files in a new directory, e.g. /opt/oracle/instantclient. Code:
mkdir -p /opt/oracle/instantclient cd /opt/oracle/instantclient unzip instantclient-basic-linux32-10.2.0.1-20050713.zip unzip instantclient-sdk-linux32-10.2.0.1-20050713.zip echo /opt/oracle/instantclient >> /etc/ld.so.conf ldconfig Code:
ln -s libclntsh.so.10.1 libclntsh.so ln -s libocci.so.10.1 libocci.so Code:
apt-get install php-pear Code:
mkdir -p /usr/local/src cd /usr/local/src pear download oci8 tar xzf oci8-1.1.1.tgz cd oci8-1.1.1 phpize ./configure --with-oci8=shared,instantclient,/opt/oracle/instantclient make make install To enable the oci8 module in the php.ini (/etc/php5/apache2/php.ini and /etc/php5/cli/php.ini), add a line Code:
extension=oci8.so Now stop and start Apache. You should see the oci8 module in the output of phpinfo(). |
|
|
|
|
|
#2 |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2005
Location: San Francisco, US
Beans: 141
Hardy Heron (Ubuntu Development)
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
I've followed the instructions, but get the following error when running the ./configure command. Do I need version 3.4 or something (I've seen as a problem elsewhere)?
checking how to run the C++ preprocessor... /lib/cpp configure: error: C++ preprocessor "/lib/cpp" fails sanity check Thanks, Tom
__________________
Dell Inspiron 1420n running Hardy i386. |
|
|
|
|
|
#3 |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2005
Location: San Francisco, US
Beans: 141
Hardy Heron (Ubuntu Development)
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
Solved with:
sudo apt-get install build-essential Thanks, Tom
__________________
Dell Inspiron 1420n running Hardy i386. |
|
|
|
|
|
#4 |
|
First Cup of Ubuntu
![]() Join Date: Apr 2006
Beans: 1
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
for phpize use:
sudo apt-get install php5-dev |
|
|
|
|
|
#5 |
|
First Cup of Ubuntu
![]() Join Date: Jul 2006
Beans: 1
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
An excellent howto! Thanks - you've really saved me!
I tried with the basiclite version that oracle makes available and it didn't work very well (at all) - the issue was that it's missing the libociei.so library. Be sure to use the full basic client. Currently instantclient-basic-linux32-10.2.0.2-20060331.zip I also had to set the environ a little as well: export LD_LIBRARY_PATH=/opt/oracle/instantclient/ Good luck! |
|
|
|
|
|
#6 |
|
First Cup of Ubuntu
![]() Join Date: Jul 2006
Location: Vladivostok, Russia
Beans: 1
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
At least with Ubuntu 6.06 and oci8-1.2.1 you don't need to compile oci8 extension manually. Just run:
Code:
pecl install oci8 |
|
|
|
|
|
#7 |
|
First Cup of Ubuntu
![]() Join Date: Dec 2005
Beans: 3
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
Is the module supposed to show up in phpinfo after its installed?
|
|
|
|
|
|
#8 | |
|
First Cup of Ubuntu
![]() Join Date: Dec 2005
Beans: 3
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
Quote:
in /etc/php5/apache2/php.ini (since I'm using the php_mod) : Code:
extension=oci8.so For me also, I had to add www-data to the oinstall group to give it access to my oracle files... Hope that helps someone |
|
|
|
|
|
|
#9 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Illinois
Beans: 273
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
How do I connect to Oracle? I installed everything as said above. I now want to connect to Oracle and see if it works.
ps: I have Oracle XE also installed, so I'm not sure if it will affect the Oracle instant client or it can co-exist with Oracle instant client. Edit: Sorry for the confusion. I didn't realize that Oracle instant client is to connect PHP to Oracle Databas. I have Oracle XE installed. Are there any environment variable that needs to be set to access the Oracle XE database I installed?
__________________
=============================== My Blog: http://www.blog.arun-prabha.com/ My Home: http://www.arun-prabha.com =============================== Last edited by arunsub; July 25th, 2006 at 09:01 PM.. |
|
|
|
|
|
#10 |
|
5 Cups of Ubuntu
![]() Join Date: Feb 2006
Location: South Africa
Beans: 32
Ubuntu 7.10 Gutsy Gibbon
|
As mentioned at http://forums.oracle.com/forums/thre...04923&tstart=0
you set environment variables for Oracle 10g XE in Linux by :- source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh this could also be done as . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh but don't make the same mistake that I did by leaving out the dot space at the beginning of the above line. My question is, does this overall solution work for getting OCI8 to access local Oracle databases? I thought instantclient was only for remote DataBases.
__________________
Regards, Alf Stockton Last edited by Alf Stockton; July 26th, 2006 at 04:45 AM.. Reason: misspelling etc |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|