Title: Installing Oracle Instant Client 11g and PECL OCI8 Post by: Gena01 on January 03, 2008, 10:19:57 pm This is part 2 of my installation instructions. This is my attempt to provide an updated and simplified reference. I am leaving Part 1 (http://www.gena01.com/forum/gena01_blog/installing_oracle_instant_client_and_making_it_work_with_php-t184.0.html) as is, because that part can also be useful.
NOTE: I am running Mandriva 2008 release. So most of the relevant packages and commands are for Mandriva. Installation of Oracle Instant Client 11g is quite similar to 10g except that 11g requires libaio1 to be installed. urpmi libaio1 (as root) worked for me. 1. Download the Oracle Instant Client for Linux rpms from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html (http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html). The files that I am using and that you will need are: Code: oracle-instantclient-sqlplus-11.1.0.1-1 3. Install libaio1 urpmi libaio1. NOTE: This is a new dependency for 11g. 4. Install those rpms to your linux system: Code: sudo rpm -ivh oracle-instantclient-* 5. You need to be root at this point: Code: sudo bash 7. You will also need to grab a copy of tnsnames.ora file either from your Oracle DBA or from another system. Code: copy tnsnames.ora /etc/oracle Code: vi /etc/profile.d/oracle.sh Code:
Code: export Simplified Pecl OCI8 installation: 1. # pear install pecl/oci8 2. You will be prompted with an option to provide instant client lib directory: a. enter 1 - NOTE: Don't select autodetect as this never worked for me. b. enter instantclient,/usr/lib/oracle/11.1.0.1/client/lib c. press Enter to continue. d. It should build and install the oci.so. 4. Create a file called /etc/php.d/999_oci.ini and place the following line there: Code: extension=oci8.so Code: ### 7. And you are done. Pull up a page that calls phpinfo() and confirm that oci8 is loaded in apache and that the environment variables are setup properly. You can also do "php -m" to see of php cli loads the module as well. Also Rob Richard posted some of his notes battling SELinux while trying to install Oracle Instant Client and getting it to work with PHP. Read the article here (http://www.cdatazone.org/index.php?/archives/37-PHP,-Oracle-and-SELinux.html) Let me know how it works out for you. Gena01 Title: Re: Installing Oracle Instant Client 11g and PECL OCI8 Post by: Anonymous Poster on February 11, 2008, 02:02:08 pm Great instructions! FYI for Debian/Ubuntu users - step 5 in the section "Simplified Pecl OCI8 installation:" should reference editing /etc/apache2/envvars instead of /etc/sysconfig/http
Title: Re: Installing Oracle Instant Client 11g and PECL OCI8 Post by: Alex Gorbachev on February 25, 2008, 11:44:05 pm Interesting why on earth would it require libaio on client side? Maybe "feature" of the first release?
Also, perhaps it's PECL specific, but for generic instant client you don't have to use /etc/oracle and can use you local profile like ~/.profile. Do you? Title: Re: Installing Oracle Instant Client 11g and PECL OCI8 Post by: Gena01 on February 25, 2008, 11:59:07 pm 1. rpms won't install without libaio1 present on the system.
2. /etc/oracle is there so that tnsnames.ora could be placed there and having TNS_ADMIN pointing at the tnsnames.ora globally so the Oracle names can be resolved for anybody. Also some of the other config files can also be placed there to debug or trace the Oracle client. ~/.profile is a login script, which is a bit different. Gena01 |