composer require yajra/laravel-oci8:^8 in laravel 8

3.2k Views Asked by At

PHP version 7.3.22 Running on Laravel Framework version 8

root@df77c47e6f1e:/var/www/oracle-laravel-v8# composer require yajra/laravel-oci8:^8

PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: /usr/lib/php/20180731/oci8_12c (/usr/lib/php/20180731/oci8_12c: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/oci8_12c.so (/usr/lib/php/20180731/oci8_12c.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /usr/lib/php/20180731/pdo_oci (/usr/lib/php/20180731/pdo_oci: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_oci.so (/usr/lib/php/20180731/pdo_oci.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.

2

There are 2 best solutions below

0
On

There is nothing wrong about laravel and composer here. It seems that your system's php installation/configuration is wrong (pdo_oci extension is missed or misconfigured) so it can't process anything, even fails at composer startup.

Composer itself is package manager written in php. And laravel is framework written in php. So it's laravel is running on php, not vice versa.

1
On

Run composer self update command and clear composer cache

composer self-update

Then

composer clear-cache