![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
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: 3
|
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: Oct 2005
Beans: 3
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
Quote:
SetEnv LD_LIBRARY_PATH /opt/oracle/instantclient in apache. export LD_LIBRARY_PATH=/opt/oracle/instantclient/ may still work but then you gotta be more precise for what user you do this. more about this at http://www.phpfreaks.com/forums/inde...5498.msg382340 |
|
|
|
|
|
|
#9 |
|
Spilled the Beans
![]() |
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
I tried doing that, but Apache is disconnecting and throwing a segmentation fault. How can I fix that?
|
|
|
|
|
|
#10 |
|
First Cup of Ubuntu
![]() Join Date: Oct 2007
Beans: 2
|
Re: Howto: Install Oracle Instant Client and PHP OCI8 module
Hi ,
enter I didl this command "pecl install oci8" I got this error ? /usr/bin/ld: skipping incompatible /opt/oracle/instantclient//libclntsh.so when searching for -lclntsh /usr/bin/ld: cannot find -lclntsh collect2: ld returned 1 exit status make: *** [oci8.la] Error 1 ERROR: `make' failed Could you help me ? |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|