Skip to content

Instantly share code, notes, and snippets.

@din2011
Created October 19, 2021 15:11
Show Gist options
  • Save din2011/59e4d0632b40209fd638066dd6798bd3 to your computer and use it in GitHub Desktop.
Save din2011/59e4d0632b40209fd638066dd6798bd3 to your computer and use it in GitHub Desktop.
ORACLE in Linux XAMPP (Ubuntu)
Original Reference : https://medium.com/@arisandyrico/oracle-in-linux-xampp-aaefae236bd4
1. Install Oracle Instant Client
First you need to install Oracle Instant Client which you can find here https://www.oracle.com/database/technologies/instant-client/downloads.html. Download at least for Basic with description OCI support, and SDK/Devel. For easy use, I download it RPM then install it using “alien” command.
( I Downloaded OL8 RPM )
sudo alien -i oracle-instantclient-basic-21.3.0.0.0-1.el8.x86_64.rpm
sudo alien -i oracle-instantclient-devel-21.3.0.0.0-1.el8.x86_64.rpm
*note : -i for install
2. Setting ORACLE_HOME & LD_LIBRARY_PATH
nano ~/.bashrc
# Additional PATH
export ORACLE_HOME=/usr/lib/oracle/21/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/21/client64/lib
export C_INCLUDE_PATH=/usr/include/oracle/21/client64
# lampp Path
export PATH=$PATH:/opt/lampp/bin
3. Install OCI8
Then we need to download oci8 library here https://pecl.php.net/package/oci8
which phpize
*verify if phpize from lampp. output expected : /opt/lampp/bin/phpize
which pecl
*verify if phpize from lampp. output expected : /opt/lampp/bin/pecl
cd /opt/lampp/bin/
sudo ./pecl install oci8-2.2.0 # for php 7.4
# OR sudo ./pecl install oci8 # for php 8
4. Detect OCI8
usually it happen, if oci8 still not detected or instantclient not configured then verify using this command.
sudo ./lampp oci8
Edit file /opt/lampp/etc/php.ini to include line... extension=oci8.so
Then you can check using “phpinfo()” in your php file if oci8 is installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment