Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oci8 not showing in phpinfo() / it is not getting enabled

808554Jan 5 2011 — edited Jan 6 2011
Dear All,

am getting difficulties in getting enabling OCI8, I dont know where am getting wrong?

We have WEB SERVER running at 172.X.X.X, It has Mysql,PHP installed already via cpanel/WHM (a web hosting software) it is runninng on linux 5.4


Our Web Developer wants to connect to Oracle Database

Oracle database is running on differnt machine on 10.X.X.X , it also has linux 5.4

I followed these links to and documents:-

http://www.gena01.com/forum/gena01-blog/installing-oracle-instant-client-and-making-it-work-with-php/

http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html

http://blogs.oracle.com/opal/2009/03/pecl_install_prompts_explained.html


These are my steps i followed


Step1:-

Cd Desktop

1, oracle-instantclient11.2-devel-11.2.0.2.0.i386.rpm
2, oracle-instantclient11.2-sqlplus-11.2.0.2.0.i386.rpm
3,oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm

root@web [~/Desktop]# rpm -Uvh oracle-instantclient*.*

Step2:-

Create /etc/oracle
Create tnsnames.ora in oracle directory

Step3:-
Create a shell script that will initialize Oracle environment variables
vi /etc/profile.d/ .env
export TNS_ADMIN=/etc/oracle/
export SQLPATH=/usr/lib/oracle/11.2/client/bin
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib:$LD_LIBRARY_PATH
export PATH=$PATH:$SQLPATH
export ORACLE_HOME=/usr/lib/oracle/11.2/client

Step4:-

ln -s libclntsh.so.11.1 libclntsh.so

Step5:-
pecl install oci8-1.4.3.tgz

downloading oci8-1.4.3.tgz ...
Starting to download oci8-1.4.3.tgz (153,515 bytes)
....done: 153,515 bytes
10 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Please provide the path to the ORACLE_HOME directory.
Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] " I press enter for autdetect"

*it gave me error "ERROR: `/root/tmp/pear/oci8/configure --with-oci8' failed"*

I searched for this error i am still getting the same error,

Then i try to install the OCI8 manuallay.( I followed this link "http://in.php.net/manual/en/oci8.installation.php"

Installing OCI8 from PECL

For a manual install, download the PECL OCI8 package, e.g. oci8-1.3.5.tgz.


■Extract the package:


tar -zxf oci8-1.3.5.tgz
cd oci8-1.3.5

■Prepare the package:


phpize

■Configure the package, either using $ORACLE_HOME or Instant Client


./configure -with-oci8=shared,$ORACLE_HOME

or


./configure -with-oci8=shared,instantclient,/path/to/instant/client/lib

■Install the package:


make install


After either an automatic or manual install, edit your php.ini file and add the line:

I went to all locations below to edit php.ini file
/scripts/php.ini
/usr/lib/php.ini
/usr/local/cpanel/3rdparty/etc/roundcube/php.ini
/usr/local/cpanel/3rdparty/etc/horde/php.ini
/usr/local/cpanel/3rdparty/etc/phppgadmin/php.ini
/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
/usr/local/cpanel/3rdparty/etc/php.ini
/usr/local/lib/php.ini
/etc/php.ini

I added the lines below

extension_dir = "/root/oci8-1.4.5/modules"
extension=oci8.so


I checked the extension installed

php --ri oci8

OCI8 Support => enabledVersion => 1.4.5
Revision => $Revision: 305257 $
Active Persistent Connections => 0
Active Connections => 0
Oracle Instant Client Version => 11.2Temporary Lob support => enabled
Collections support => enabled

Directive => Local Value => Master Value
oci8.max_persistent => -1 => -1
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
oci8.default_prefetch => 100 => 100
oci8.old_oci_close_semantics => Off => Off
oci8.connection_class => no value => no value
oci8.events => Off => Off

When I check the the URL http://hafilstc.com/phpinfo.php

oci8 block doesnt show up there it just sayz "extension_dir /root/oci8-1.4.5/modules /root/oci8-1.4.5/modules as locall and mater value

I dont know what to do now, am stuck in middle
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2011
Added on Jan 5 2011
2 comments
10,220 views