Use of undefined constant OCI_CRED_EXT - assumed 'OCI_CRED_EXT' laravel

99封情书 提交于 2021-01-29 18:21:04

问题


I'm trying to connect oracle database to my laravel application using this package: https://github.com/yajra/laravel-oci8 but having error with the external connection, this is the error:

Here the line of error in package: https://github.com/yajra/laravel-oci8/blob/5.8/src/Oci8/Connectors/OracleConnector.php#L35

System details

  • Operating System: macOS Mojave Version 10.14.4 (18E226)
  • PHP Version: 7.3
  • Laravel Version: 5.8.*
  • Laravel-OCI8 Version: 5.8.*

Anyone can help me please?


回答1:


Looks like the predefined constants for your OCI8 extension is missing. Make sure that the OCI8 extension was either

  1. Correctly compiled into PHP (See https://www.orware.com/blog/tips-and-how-tos/oracle/oracle-oci8-php-installation)

  2. Dynamically loaded at runtime. You can check this in your script and an example of how to do this is shown here: https://www.sitepoint.com/php-extension-not-loaded/




回答2:


In your php.ini file find and uncomment the following line.

extension=oci8_12c

Then, restart your web server. And/Or PHP container - if you are using one, e.g. php-fpm, hhvm.



来源:https://stackoverflow.com/questions/56105831/use-of-undefined-constant-oci-cred-ext-assumed-oci-cred-ext-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!