无法安装 laravel oci8

Cannot install laravel oci8

composer require yajra/laravel-oci8:^8 命令出现以下错误:

C:\Users\yö\PhpstormProjects\BRP>composer require yajra/laravel-oci8:^8
./composer.json has been updated
Running composer update yajra/laravel-oci8
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires yajra/laravel-oci8 8 -> satisfiable by yajra/laravel-oci8[v8.0.0].
    - yajra/laravel-oci8 v8.0.0 requires ext-oci8 >=2.0.0 -> it is missing from your system. Install or enable PHP's oci8 extension.

To enable extensions, verify that they are enabled in your .ini files:
    - C:\PHP74\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Windows 10
PHP 7.4.6
Laravel 8.26.1
PHP Storm 2020.2.3

我没有使用 XAMMP 或 WAMP

希望有人能帮帮我。提前谢谢你。

您缺少 OCI8 PHP 扩展,因此请按照以下步骤操作:

  1. http://pecl.php.net/package/oci8 下载确切的版本,因为你必须是 php_oci8-2.2.0,解压并复制到 PHP ext 文件夹,对你来说它在“ C:\php74\ext"

  2. 在 php.ini 中取消注释“extension=php_oci8_11g.dll”并重新启动 Apache 或您正在使用的任何其他 Web 服务器

  3. 检查php_info(),应该启用oci8。

  4. 运行 composer require yajra/laravel-oci8:^8 再次命令。

https://windows.php.net/downloads/pecl/releases/oci8/

中下载具有合适 php 版本的扩展

提取所有 .dll 文件并将其复制到 /xampp/php/ext

http://www.oracle.com/technetwork/topics/winsoft-085727.html

中下载合适的 OS 和 PHP 版本的即时客户端 oracle

解压并复制所有dll文件到/xampp/apache/bin/,再复制到/xampp/php/

安装https://github.com/yajra/laravel-oci8