Require ext-oci8 >=2.0 0 it is missing from your system install or enable phps oci8 extension

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.

Require ext-oci8 >=2.0 0 it is missing from your system install or enable phps oci8 extension

bhucho

3,6123 gold badges15 silver badges29 bronze badges

asked Feb 5, 2021 at 8:39

Require ext-oci8 >=2.0 0 it is missing from your system install or enable phps oci8 extension

1

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.

answered Feb 5, 2021 at 9:50

Require ext-oci8 >=2.0 0 it is missing from your system install or enable phps oci8 extension

Pejman KheyriPejman Kheyri

2,9767 gold badges30 silver badges31 bronze badges

5

Summary of problem or feature request

I tried to run composer require yajra/laravel-oci8:"5.6.*" OR composer require yajra/laravel-oci8, it resulted the error on the title.
I tried to use every oci8 dll available for PHP 7.2 (x86 TS, x86 NTS, x64 TS, x64 NTS) but still the laravel oci cant be installed. I previously used the 7.1 php but have to updated it to the latest version for maybe it gives some helps, but no luck for me.

Is that trying to say that I should use the 2.0.0 version of oci8 dll? The thing is there is no 2.0.0 version for Windows. >> https://pecl.php.net/package/oci8

I read so many tips on some sites, but none of it works.
There is 1 thread about it here > #353
But someone locked it even thou the issue has not been solved. And the one in the comment who maybe tried to help is not helping at all.

Code snippet of problem

composer require yajra/laravel-oci8

System details

  • Operating System : Win 8 x64
  • PHP Version: 7.2.4
  • Laravel Version: 5.6
  • Laravel-OCI8 Version: 2.1.8
  • XAMPP x86

OCI8 is PHP’s library for talking to Oracle databases, but installing it on Ubuntu is not particularly simple. Here’s what I did, on Ubuntu 12.04. My instructions are based on these by Naveen S Nayak, plus some bits I had to figure out.

Firstly, you’ll need a working Apache / PHP stack to add your Oracle stuff to. Once you’ve got that going, you need to download two ZIP files from Oracle, the Instant Client Package — Basic and the Instant Client Package — SDK. Download them here (http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html) for 64 bit Ubuntu, 32 bit is at http://www.oracle.com/technetwork/topics/linuxsoft-082809.html.

Unzip the files in the basic package to /opt/oracle_instantclient. Next, unzip the SDK package and copy the sdk directory inside that to /opt/oracle_instantclient, so that it lives at /opt/oracle_instantclient/sdk.

Note: Both the ZIP archives I downloaded contained a directory at their root called “instantclient_12_1”, with no other duplicate files. You could therefore just unzip both archives to the same location, then move the resulting directory to /opt and rename it “oracle_instantclient”.

Next we need to create a symlink –

cd /opt/oracle_instantclient sudo ln -s libclntsh.so.12.1 libclntsh.so

Note: Check the file you’re linking to above exists — the version number might be different for you.

Now we need to install some packages to allow us to build the PHP extension.

sudo apt-get install php5-dev libaio-dev php-pear sudo pecl install oci8

The pecl install will ask you to tell it Oracle’s home directory, the answer you need to give is

instantclient,/opt/oracle_instantclient

You should then see a congratulatory message along the lines of “Build Process completed successfully”.

Now we need to tell PHP about our new extension, like this

sudo echo “extension=oci8.so” > /etc/php5/conf.d/oci8.ini

Now we need to make sure that PHP apps know where to look for the extension, by adding an Apache environment variable (annoyingly, adding this as a system-wide environment variable didn’t work for me). You can add this to any of Apache’s various conf files, or to your virtualhost config, if that suits.

I added the following to /etc/apache2/apache2.conf

SetEnv LD_LIBRARY_PATH=”/opt/oracle_instantclient”

Then I needed to set the permissions on that directory to allow Apache to access it.

sudo chown -R root:root oracle_instantclient/ sudo chmod -R g+x oracle_instantclient/

And finally, restart Apache –

sudo service apache2 restart

Congratulations! You should now be able to use PHP’s oci_* functions.

How do I install or enable PHP's OCI8 extension?

The OCI8 extension can be added to an existing PHP installation by using the » PECL repository. When prompted, enter either the value of $ORACLE_HOME , or instantclient,/path/to/instant/client/lib . Make sure the php. ini directive extension_dir is set to the directory that oci8.so was installed in.

How to enable OCI8 in PHP windows?

1 Answer.
Download instantclient and place "C:\instantclient_11_2".
Set environment variable for C:\instantclient_11_2..
Check your php version i.e. PHP Version 5.6.15..
Un-Comment "extension=php_oci8_11g.dll" in php.ini and restart apache..
check php_info(), oci8 should be enabled. Thats all..

How install OCI8 on Linux?

How to install Oracle Client Instant (OCI8) on Linux.
Download the latest Oracle Instant Client and SDK. ... .
Extract the files. ... .
Add in the ldconfig's config folder. ... .
Install packages. ... .
Install the OCI8 extension via PECL. ... .
Load extension from php.ini. ... .
Restart & check..

What is OCI8 PHP?

PHP. Description. The OCI8 extension lets you access Oracle Database. Use 'pecl install oci8' to install for PHP 8.1.