We recently moved our site to a new server using Laravel Forge. Everything went well except we keep getting "Use of undefined constant OCI_CRED_EXT" errors because the oci8 extension doesn't seem to be running correctly. Running "php -m | grep 'oci8'" works and echos out oci8, so the extension seems to be running, but when we run a phpinfo() we aren't seeing any of the oci8 configuration. In that info screen oci8 is only listed in the Module Authors.
We followed the instructions here https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e (making sure to use the "pecl install oci8-2.2.0" so it works with php 7.4). After that we added some environment variables to /etc/environment as suggested in https://serverfault.com/questions/743976/how-to-detect-php-oracle-using-ubuntu-nginx-php7-fpm.
We are running Ubuntu 20.04 LTS, php 7.4, and Laravel 6.2. At this point I'm running out of things to try. If anybody has any ideas it would be a huge help.
CodePudding user response:
If OCI8 is available in command line, but not via a web request then it means you haven't configured the Oracle environment variables and/or LD_LIBRARY_PATH for your webserver to find the Oracle libraries and files. How you set these depends on the webserver (and version of the webserver), and how you installed the Oracle client libraries. With Instant Client, you can probably just use the ldconfig
method shown in the installation instructions and may not need to set any other variables.