How to connect php application to oracle db on rhel 7.9
My php project uses oracle db and it runs on Linux environment. I believe I need to download oci8 for Linux but I can't find this version of oci8 [php-oci8-5.4.16-48.el7.rpm] anywhere. Can anyone have any clue to solve this issue? Any link/document? Please Help
Solution 1:
based on this manual on php web site you should use pecl
Run
pecl install oci8
Edit your php.ini
file and add the line:
extension=oci8.so
In case of problem follow this answer:
For anyone stumbling upon this question, here is the proper way to handle it in linux. (I am using CentOS commands for the demo below but Ubnutu shouldn't be any different) step 1: get oracle libs
EDIT: Thanks to Christopher Jones for the comment, you can find the direct rpm links at https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/
wget oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
wget oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
step 2: install
yum install oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
yum install oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
step 3: configure (make the path of the oracle libs to be discoverable)
sudo sh -c "echo /usr/lib/oracle/18.3/client64/lib > /etc/ld.so.conf.d/oracle.conf"
sudo ldconfig