Holy moly, I got it working! It took an insanely long time to piece together, but it's finally working!
I took some direction from
https://medium.com/@arisandyrico/oracle-in-linux-xampp-aaefae236bd4, but couldn't get it working until I made a few minor modifications. I'll document what finally did it for me - - hopefully, it'll resolve the issue if anyone else has need of it as well?
For this test, I used a fresh install of Linux Mint 18.1 XCFE, fully updated.
1. Install the XAMPP package as usual. For the purpose of this test, I used
xampp-linux-x64-7.4.8-0-installer.run2. Install the
oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64 and
oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64 packages into /usr/lib/oracle/. I basically just followed step 1 of the above-linked blog post, after installing
alien, and downloading the .RPM packages.
3. I wasn't sure if this step was needed or not, but I did it anyhow - - this is step #2 of the above-linked blog post. I basically copy/pasted everything between the "---------------------" to the end of the ~/.bashrc file. I then exited the terminal, and re-launched it.
- Code: Select all
2. Setting ORACLE_HOME & LD_LIBRARY_PATH
I have an issues that my path always getting reset each time I open new terminal. If that happens to you then edit file with this command.
nano ~/.bashrc
then add this
----------------------------------------
# enable programmable completion features (you don’t need to enable
# this, if it’s already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
#*code above just notify if you are in correct .bashrc
# MOD <=============insert it to add new variable
# Additional PATH
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
# lampp Path
export PATH=$PATH:/opt/lampp/bin
---------------------------------
4. Run
sudo apt install php-pear5. Download
oci8-2-2.0.tgz from https://pecl.php.net/package/oci8
6. Extract it using
tar xzvf oci8.tgz7. Recursively update the permissions of the extracted oci8-2.2.0 folder to allow full read/write access.
8. Recursively update the permissions of the /opt/lampp directory to allow full read/write access.
9. Copy/paste the oci8-2.2.0 folder into the /opt/lampp directory
10. Open (or switch to) the /opt/lampp/oci8-2.2.0 directory in your terminal
11. Enter
which phpize, and verify that the return value is
/opt/lampp/bin/phpize12. Run
phpize13. Run
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib (Note- this will fail if you didn't update the permissions above!)
14. Run
make all install15. Run
sudo /opt/lampp/lampp oci8When this runs, just press ENTER when prompted for the path to Instant Client!16. Recursively update the permissions of the /opt/lampp directory to set read-only for all but root.
You can then go in & modify individual subdirectories to allow write access as needed. (such as /opt/lampp/htdocs)
Cross your fingers, restart XAMPP... and hopefully you'll now see OCI8 in your phpinfo() output!
https://imgur.com/a/KeJuk3J
And just to verify, a simple test connection to Oracle *does* now function in XAMPP.
https://imgur.com/a/SWbwJvh
I don't quite understand why the built-in ./lampp oci8 program linking to the wrong 11.2.0.3.0 instant client instead of the newly-installed 12.2.0.1.0 actually works.... but it did? And as far as I'm concerned, that's a win in my book!
I was able to uninstall XAMPP and then re-install, and it stopped working. Repeating steps 6-16 were successful in re-enabling OCI8, so I suspect it has something to do with the oci8-2-2.0.tgz being copied & compiled directly in the /opt/lampp directory before the built-in /opt/lampp/lampp oci8 program will work? I haven't traced exactly what that may be.... but since it's working for me this way, I'll probably just accept it as-is.