Skip to content

Instantly share code, notes, and snippets.

@jgaydos
Created February 14, 2019 01:30
Show Gist options
  • Save jgaydos/d5c7292f4b071b1d1e239e417bc126f4 to your computer and use it in GitHub Desktop.
Save jgaydos/d5c7292f4b071b1d1e239e417bc126f4 to your computer and use it in GitHub Desktop.
Ubuntu 18.04 + PHP7.3 + OCI8 (must provide your own oracle rpms)
#!/bin/bash
#install
apt -y install alien build-essential php7.3-dev libaio1
alien oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
alien oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
alien oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
dpkg -i oracle-instantclient12.2-basic_12.2.0.1.0-2_amd64.deb
dpkg -i oracle-instantclient12.2-devel_12.2.0.1.0-2_amd64.deb
dpkg -i oracle-instantclient12.2-sqlplus_12.2.0.1.0-2_amd64.deb
pecl install oci8
# enter instantclient,/usr/lib/oracle/12.2/client64/lib
echo "extension= oci8.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
echo "export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib" >> ~/.bashrc
echo LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib >> ~/.profile
echo LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib >> /etc/environment
echo "export ORACLE_HOME=/usr/lib/oracle/12.2/client64" >> ~/.bashrc
echo ORACLE_HOME=/usr/lib/oracle/12.2/client64 >> ~/.profile
echo ORACLE_HOME=/usr/lib/oracle/12.2/client64 >> /etc/environment
source ~/.bashrc
source ~/.profile
echo "do you wanna restart your computer to apply changes in /etc/environment file? yes(y)no(n)"
read restart
case $restart in
y) sudo shutdown -r 0;;
n) echo "don't forget to restart your computer manually";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment