Obviously, this has been successful for a number of people. I did finally get it installed on Ubuntu 10.04 Desktop 32bit, with much frustration. However, I never got it working on 64bit server.
Can someone point me to useful step-by-step instructions for getting a LAMP setup with PDO_OCI installed and working in Ubuntu Server? Preferably, I'd like to use 10.04 Lucid 64bit. If this is known to not work, or if a different version of Ubuntu Server is preferred, I'd like to know that too. I'm going to connect to an external Oracle server, so I don't need to know how to install the Oracle server stuff.
Thanks!
Comments
Comment #1
oshelot CreditAttribution: oshelot commentedWhat issues did you encounter on 64-bit that were not present on 32? Was it with compiling the PDO_OCI driver or something during the actual install process?
Comment #2
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedMy issues were mostly that there is no good documentation, and what I ended up doing, I only managed to scrape from a half-dozen different articles spread across different linux versions, all advising to install stuff in different places. I honestly have no idea what I did that actually got the the 32bit working. I know it involved installing a bunch of different stuff from Oracle, pecl, and apt-get, patching some of it in random ways, and attempting to compile each time.
It finally worked with 32bit, but, like I said, I'm not likely to easily replicate my process.
I'm working on attempting a 64bit Lucid server install in the next week or two, and I hope to completely document my process. I'm just hoping that maybe somebody has written something definitive that would help me.
Comment #3
oshelot CreditAttribution: oshelot commentedI wrote a how to here http://inode.me/tutorials/how-to-drupal-7-oracle-xe-install which you may have already seen. Mine is on 32-bit only because Oracle doesn't release 10g XE in 64. I believe they did release the beta of 11g in 64 though. Anyway, I really don't see what difference there would be with 32/64-bit or the version of Linux for that matter. Why don't you try on a 64-bit and then post something when you have an error?
Comment #4
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedOkay, I got it to work by throwing together a bunch of articles that I found on the web. Here is the documentation that seemed to work for me. Some of these commands I'm not sure WHY I had to do them (the article just said "Do this, trust me"). Also, even though it worked, I may have gotten instantclient 11.1 and 11.2 confused. So if there are unnecessary steps, or other fine-tuning that can be done, let's correct them here so we can submit a good docs page in the handbook.
All this time, I'm thinking: Why is this so hard? I guess it's mostly because PDO_OCI hasn't been updated since 2005.
Oracle Clients on 10.04 Ubuntu Server 64-bit
10.04.3 installer image
## During Installation, select these server types:
LAMP Server
OpenSSH Server
## Download Oracle OCI clients for Linux:
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
## Download to /usr/lib/oracle/:
instantclient-basic-linux-x86-64-11.2.0.2.0.zip
instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip
instantclient-sdk-linux-x86-64-11.2.0.2.0.zip
## Unzip files to instantclient_11_2/ and rename repository
## Setup $ORACLE_HOME and associated links
## Install extra php stuff
## The installers all look for stuff in the wrong place. These links make it so it doesn't matter.
#Install OCI8
## Download PDO_OCI
## Patch PDO_OCI since it hasn't been updated since 2005
# copy the lines below into the file "config.m4.patch"
## Build and install PDO_OCI
## Add extensions to PHP
# Create /etc/php5/apache2/conf.d/pdo_oci.ini
## restart Apache
## Install Drupal, Drush, Oracle client, etc. like normal.
Comment #5
aaaristo CreditAttribution: aaaristo commentedthanks Shawn for the contributed docs... i hope someone find the time to review it and patch the INSTALL.txt ;)
Comment #6
aaaristo CreditAttribution: aaaristo commentedComment #7
radalin CreditAttribution: radalin commentedYou might use Zend Server CE for a ready to use Oracle stack. even though it includes, it's own apache etc. It's easy to start from scratch. It comes preinstalled with some goodies (or bloatware) and it's ready for prod too.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedI got it working!! Here is my revised version of this howto:
Installing the PHP_OCI driver for Oracle databases
This step-by-step was adapted from the Ubuntu howto above. It worked for me on Debian/Linux64 Lenny (5.0) in the year 2012. As I wrote up this howto I tested a few things and ran into a new error... but my initial run through was successful. Good luck!
Please note: the patch you will do uses "11.1" as the version number. It will work with version 11.2 and later (but unless you update the patch, you should continue using "11.1" in the ./configure command).
## Download the following instantclient files from Oracle's website
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
## Move the files to our install location, /usr/lib/oracle/instantclient
## Fix some poorly named files and add them to our system's library index:
## Fix more stupid paths:
## Download PDO_OCI
## Patch PDO_OCI since it hasn't been updated since 2005
# copy the lines below into the file "config.m4.patch"
## Attempt to compile (this is where you're probably stuck, make sure you're in your PDO_OCI folder!)
## Add extensions to PHP
# Create /etc/php5/apache2/conf.d/pdo_oci.ini
extension=pdo_oci.so
## restart Apache
/etc/init.d/apache2 restart
Congratulations you made it!
## install Drupal!
Read the INSTALL file in the Drupal oracle module. It must be put in a special place in Drupal's filesystem!
Comment #9
bencornwell CreditAttribution: bencornwell commentedAwesome! That worked perfectly, thank you! You've ended many hours of frustration!
Comment #9.0
bencornwell CreditAttribution: bencornwell commentedadded clarity regarding Oracle Server.
Comment #10
jurgenhaasI followed all instructions from comment #8 and got as far as to
./configure --with-pdo-oci=instantclient,/usr/lib/oracle/instantclient,11.1
which closes with an error: Cannot find php_pdo_driver.h.
Any idea what I'm doing wrong?
Comment #11
jurgenhaasFound a solution here (http://berryllium.nl/2012/02/configure-error-cannot-find-php_pdo_driver-...):
ln -s /usr/include/php5 /usr/include/php
Comment #12
baldasso CreditAttribution: baldasso commentedIf you get an error:
/tmp/pear/download/PDO_OCI-1.0/pdo_oci.c:34:1: error: unknown type name ‘function_entry’
change function_entry in pdo_oci.c to zend_function_entry
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedHey folks, two years later still seeing updates on this issue I want to throw in my 2¢ on how I would approach this in the future since I'm not maintaining the revised instructions I provided above. Hopefully it will save some time for the next person(s) going down this trail.
With the driver and installing the DB I would have been better off using a derivative of RedHat, because that is what it is written for. Further, I would not bother looking at virtualization of the environment as Oracle DBs like hardware. Augmenting config for Debian/Ubuntu/etc. in the long run is going to be a hassle, mainly because of library linking and the old drivers not knowing about newer compatible versions of things.
What you probably want to do to make your life easier is find an old PC, download Oracle's version of Linux (based on RedHat) which has all of this stuff either built-in or ready-to-go. Install it on your old laptop or something. Or find a hardware host that will let you provide your own ISO and use Oracle's. Install whatever you need to run Drupal, and then check out your code from your version control onto that machine and proceed from there.
If you're considering co-building with a tried-and-true database like MySQL/MariaDB alongside your Oracle version you might consider using Migrate to stage content if it isn't accessible to the client. Or you could do some fancy networking.
Comment #14
oshelot CreditAttribution: oshelot commentedI just migrated my site from oracle-XE 10.2 to 11.2. I used a standard CentOS 6.2. While I much prefer Ubuntu, a little research will reveal that running on a Redhat variant will make your life easier (first clue, no dpkg). Installed all the prerequisite packages along with the instantclient-{basic,devel} rpms. That part is simple enough. The problem here is that PDO_OCI isn't maintained so you have to patch config files and symlink stuff just to compile against 11.x libraries. It wouldn't be such a pain if these patches were just committed.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedOh one more thing that has come to my attention since doing this stuff... DBTNG Migrator. This allows you to convert between database types. So if you have a MySQL based site, and you managed to get the Oracle driver installed, you can set the Oracle DB as secondary in your settings.php and use this module to transform the MySQL data into Oracle form. I have tried this doing MySQL -> SQLite and it worked perfectly.