问题
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
Correctly compiled into PHP (See https://www.orware.com/blog/tips-and-how-tos/oracle/oracle-oci8-php-installation)
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