I want to share some information about my OCI8 installation to access Oracle databases.
If you got errors like "PHP Startup: Unable to load dynamic library 'oci8.so'"
or "checking Oracle Instant Client library version compatibility… configure: error: Link from libclntsh.so to /opt/oracle/instantclient/libclntsh.so.*.1 not found"
or just want to install Quick&Easy OCI8 to get a connection between your php and an Oracle database, you are at the right place!
Best Answer
First prerequirements are a working apache2 and php7.2 (Ubunti 18.04) environement.
Download the basic (like instantclient-basic-linux.x64-12.2.0.1.0.zip) and the sdk (instantclient-sdk-linux.x64-12.2.0.1.0.zip) package from the Oracle Website http://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
Upload both files to your webserver, you can use WinSCP for it
Unzip both files on server, in my case, you will get a new folder named "instantclient_12_2"
4a. Create destination folder
4b. Move and rename the instantclient folder
4c. Change rights on folder
7a. Add instant client to ld config files
7b. Update Dynamic Linker Run-Time Bindings
8a. Now install OCI8 by pecl
8b. The OCI8 installation is asking you for the right folder
9a. Add oci lib to the cli php config (console php)
9b. Add oci lib to the apache php config
10a. Set environement variables for the cli version (you will need to reboot the server after)
10b. Set environement variables for the apache version
=PHP CONNECTION EXAMPLE=