简体   繁体   English

如何将 Laravel 8 连接到 oracle 11g 数据库?

[英]How to connect Laravel 8 to oracle 11g database?

I'm trying to connect Laravel 8 to the Oracle 11g database, I tried all possible solutions but it didn't work.我正在尝试将Laravel 8连接到Oracle 11g数据库,我尝试了所有可能的解决方案,但没有奏效。 Here are my system properties:这是我的系统属性:

  1. Windows 8.1 64 bits. Windows 8.1 64 位。
  2. Laravel 8.拉拉维尔 8.
  3. Oracle 11g.甲骨文 11g。
  4. Xampp 64 bits. Xampp 64 位。
  5. PHP 7.4.10 PHP 7.4.10

This is the error message: C:\\xampp\\htdocs>composer require yajra/laravel-oci8 PHP Warning: PHP Startup: Unable to load dynamic library 'php_oci8_11g' (tried: C:\\xampp\\php\\ext\\php_oci8_11g (%1 is not a valid Win32 application.), C:\\xampp这是错误消息: C:\\xampp\\htdocs>composer require yajra/laravel-oci8 PHP Warning: PHP Startup: Unable to load dynamic library 'php_oci8_11g' (尝试: C:\\xampp\\php\\ext\\php_oci8_11g (%1不是有效的 Win32 应用程序。),C:\\xampp
php\\ext\\php_php_oci8_11g.dll (The specified module could not be found.)) in Unkn own on line 0 . php\\ext\\php_php_oci8_11g.dll(找不到指定的模块。))在 Unkn 自己的第 0 行。 . . . . The following image clarifies the problem:下图说明了问题: 在此处输入图片说明

您需要在 php.ini 文件中取消注释extension=oci8_12c并确保ext文件夹中的php_oci8_12c.dll文件。

Uncomment extension=oci8_12c by removing ;通过删除;取消注释extension=oci8_12c before it in you php.ini and then relaod php-fpm using service php-fpm restart or service php7-fpm restart replace 7 with your php version.在你的 php.ini 之前,然后使用service php-fpm restartservice php7-fpm restart service php-fpm restart用你的 php 版本替换 7。

It seems it is moved to pecl , download dll file and place that in xampp\\php\\ext\\ directory.它似乎被移动到pecl ,下载 dll 文件并将其放在xampp\\php\\ext\\目录中。 if exists replace it, restart your xampp and it should be okay now.如果存在替换它,重新启动您的 xampp,现在应该可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM