Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Tuesday, December 31, 2024

Install Oracle Instant Client (oci8) for PHP5.6 on Ubuntu 22.04

*make sure php5.6 is already install

1. Install Basic and the SDK Instant Client packages. Download from OTN

Download version 12.1.0.2.0. This file is required:

  • instantclient-basic-linux.x64-12.1.0.2.0.zip
  • instantclient-sdk-linux.x64-12.1.0.2.0.zip

2. Install OCI8 version oci8-2.0.10. Download from pecl.php.net

3. Manual install OCI8 

#tar -xzf oci8-2.0.10.tgz
#cd oci8-2.0.10
#phpize
#./configure -with-oci8=share,instantclient,/usr/lib/oracle/12.1/client64/lib
#make install

4. Enable the ORACLE global variables

#export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
#export ORACLE_HOME=/usr/lib/oracle/12.1/client64 

5. Enable oci8 in php5.6

  • create file oci.ini in /etc/php/5.6/mods-available/
  • add the extension=oci8.so to the oci.ini

6. Create symlink in php5.6 folder

#ln -s /etc/php/5.6/mods-available/oci.ini 20-oci.ini in folder /etc/php/5.6/cli/conf.d
#ln -s /etc/php/5.6/mods-available/oci.ini 20-oci.ini in folder /etc/php/5.6/fpm/conf.d

7. Validate that it was successfully installed.

#php -i | grep oci8 

Wednesday, July 29, 2015

Install Oracle Instant Client (oci8) for CentOS

Solutions

Development packages
 
# yum install php-pear php-devel zlib zlib-devel bc libaio glibc
# yum groupinstall "Development Tools"

Instant Client
1. Download the Basic and the SDK Instant Client packages from the OTN Instant Client page.
Install the RPMs as the root user, for example:

  • Latest Client 21.5.0.0.0 with Oracle 12c and PHP 8.1.
  • Before that Instant Client 21.3.0.0.0 with Oracle 12c and compiled with PHP 8.0, 7.4 and 7.3 fine.
  • Before that Instant Client 10.1.0.5.0 with Oracle 10g, 11g and 12c and PHP 5.6, 7.1, 7.2, 7.3 and 7.4.

2. Install Basic and the SDK Instant Client packages

#rpm -Uvh oracle-instantclient-XXX.rpm
#rpm -Uvhoracle-instantclient-devel-XXX.rpm

3.Check you have php-pear and php-devel packages installed by this command
# rpm -qa | grep -i php
    .....
    php-5.3.3-3.el6_1.3.x86_64
    php-cli-5.3.3-3.el6_1.3.x86_64
    .....

OCI8
4.Install oci8 extension by manual or auto

Manual
# pear download pecl/oci8
# tar -xvf oci8-version.tgz
# cd oci8-version

Build and install the extension.

# phpize
# ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/<exact path>
# make
# make install

* If got an error when to make
    compilation terminated.
    make: *** [oci8.lo] Error 1
    ERROR: `make' failed

 It seems that your PHP was built with DTrace support enabled.  
    # export PHP_DTRACE=yes
    # pecl install oci8

Auto

# pecl search oci8
# pecl install oci8

  • Use pecl install oci8 to install for PHP 8.2.
  • Use pecl install oci8-3.2.1 to install for PHP 8.1.
  • Use pecl install oci8-3.0.1 to install for PHP 8.0.
  • Use pecl install oci8-2.2.0 to install for PHP 7


OR     
# yum install php56-php-oci8-5.6.40-25.el7.remi.x86_64 - PHP56
# yum install php-oci8-7.3.27-1.el7.remi.x86_64 - PHP7

5. Enable oci8 extension

To enable the extension, add a file named oci8.ini in /etc/php.d/ with this content:
# extension=oci8.so

6. Restart http server

#/etc/init.d/httpd restart

7. Validate that it was successfully installed.

# php -i | grep oci8

You can check that the extension is installed with:

# php --ri oci8

8. Uninstall

# pecl uninstall oci8

Source :
 

https://github.com/php/pecl-database-oci8
http://www.techinfobest.com/connect-oracle-database-from-php-in-redhatcentos
http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-084410.html
http://itvomit.com/2013/10/25/getting-oracle-instant-client-php-and-oci8-all-working/

Thursday, January 20, 2011

Install Oracle 10g Database on Solaris 10

Reference site:

1. Problems:
Some requirement package is needed by Oracle 10g database

# pkginfo -i SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8

Solutions:
Install the package from Solaris 10 installation cd

# pkgadd -d . SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool
SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8

2. Problems:
Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation,at which time they will be rechecked.

Solutions:
1. Install SUNWxwplt package
2. Set DISPLAY variable
3. Execute xhost + on target (set in DISPLAY) computer

* in root privilege run this command # export DISPLAY=localhost:0.0
* in oracle privilage run instllation file #./runInstaller or #<cdrom dir>/runInstaller



3. Problems:
Checking kernel parameters
Checking for BIT_SIZE=64; found BIT_SIZE=64. Passed
Checking for noexec_user_stack=1; found no entry. Failed <<<<
Check complete. The overall result of this check is: Failed <<<<

Problem: The kernel parameters do not meet the minimum requirements (see above).
Recommendation: Perform operating system specific instructions to update the kernel parameters.

Solutions:
Need to add to /etc/system the following:

set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semmni=100
set semsys:seminfo_semvmx=32767
set noexec_user_stack=1

4. Problems & Solutions:
Create and edit file /export/home/oracle/.profile

umask 022
TMP=/tmp
TMPDIR=$TMP
DISPLAY=localhost:0.0
export TMP TMPDIR DISPLAY
ORACLE_BASE=/export/home/ [replace with ur Oracle base Directory]
ORACLE_HOME=/export/home/oracle [replace with ur Oracle home Directory]
ORACLE_SID=test [replace with your database]

PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH

5. Problems:
Error
1. OUI-10035: you do not have permission to write to the inventory location
or
2. OUI-10033:The inventory location /export/home/oraclebase/orainventory set by the previous installation session is no longer accessible. Do you still want to continue by creating a new inventory? Note that you may lose the products installed in the earlier session.

Solution:
# chown –R oracle:dba /export/home/oracle
# chown –R oracle:dba /export/hom

Start Oracle Services


  • dbstart - starting db

  • lsnrctl start - starting a listener

  • emctl start dbconsole - starting the Enterprise Manager agent

  • isqlplusctl start - Start ISQL Plus

  • opening the database (sqlplus / as sysdba then startup)


Create Oracle DB

  • ./dbca