laraveloci8

Cannot install laravel oci8


the composer require yajra/laravel-oci8:^8 command is giving me the following error:

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

I am not using XAMMP or WAMP

I hope someone can help me out. Thank you in advance.


Solution

  • You are missing the OCI8 PHP extension, So follow these steps:

    1. From http://pecl.php.net/package/oci8 download exact version, for you must be php_oci8-2.2.0, unzip it and copy to PHP ext folder, for you its in "C:\php74\ext"

    2. Un-Comment "extension=php_oci8_11g.dll" in php.ini and restart Apache or any other web server that you are using

    3. Check php_info(), oci8 should be enabled.

    4. Run composer require yajra/laravel-oci8:^8 command again.