tar -xzvf oci8–2.1.8.tgz
cd oci8–2.1.8
phpize
./configure — with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib
make
sudo make install
This will build and install the oci8 library which will be located (probably) in
/usr/lib/php/20170718/oci8.so
Now we should edit both these files…
/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini
Enable the oci8 extension by adding the line to each php.ini
extension=/usr/lib/php/20170718/oci8.so
/etc/apache2/envvars
then add the following lines:
export PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/administrador/oracle/oci8–2.1.8/modules:/usr/lib/oracle/12.2/client64:/usr/lib/oracle/12.2/client64/lib”
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
/etc/apache2/envvars
then add the following lines:
export PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/administrador/oracle/oci8–2.1.8/modules:/usr/lib/oracle/12.2/client64:/usr/lib/oracle/12.2/client64/lib”
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export ORACLE_HOME=/usr/lib/oracle/19.5/client/lib/instantclient
export TNS_ADMIN=/usr/lib/oracle/19.5/client/lib/instantclient/network/admin
export LD_LIBRARY_PATH=/usr/lib/oracle/19.5/client/lib/instantclient
sqlplus user/senha@isntancia
Doc pra diver oci oralce
# http://www.nusphere.com/kb/phpmanual/function.oci-fetch-all.htm?
https://help.ubuntu.com/community/Oracle%20Instant%20Client
https://medium.com/@kabeza/setup-oracle-instant-client-with-apache-and-php-7-on-ubuntu-server-17-04-66cea2297d6f
https://www.php.net/manual/en/oci8.examples.php