kaysus's avatar

Call to undefined function Yajra\Pdo\oci_connect( )

Hi, i have already this error :( [Symfony\Component\Debug\Exception\FatalErrorException] Call to undefined function Yajra\Pdo\oci_connect( )

my oracle.php file: #<?php return [ 'oracle' => [ 'driver' => 'oracle', 'tns' => env('DB_TNS', 'salima'), 'host' => env('DB_HOST', '172.16.0.16'), 'port' => env('DB_PORT', '1521'), 'database' => env('DB_DATABASE', 'salima'), 'username' => env('DB_USERNAME', 'TEST'), 'password' => env('DB_PASSWORD', 'TEST'), 'charset' => env('DB_CHARSET', 'AL32UTF8'), 'prefix' => env('DB_PREFIX', ''), 'prefix_schema' => env('DB_SCHEMA_PREFIX', ''), ], ]; my .env file :+1: APP_ENV=local APP_DEBUG=true APP_KEY=base64:+wgXCOFwVBlHUJCU3Hxi518odYFRjWpP0PMUFTDJW0k= APP_URL=http://localhost DB_CONNECTION=oracle DB_HOST=172.16.0.16 DB_PORT=1521 DB_DATABASE=salima DB_USERNAME=TEST DB_PASSWORD=TEST CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null database.php file: 'default' => env('DB_CONNECTION', 'oracle'), /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring each database platform that is | supported by Laravel is shown below to make development simple. | | | All database work in Laravel is done through the PHP PDO facilities | so make sure you have the driver for your particular database of | choice installed on your machine before you begin development. | */

'connections' => [

'sqlite' => [
    'driver' => 'sqlite',
    'database' => env('DB_DATABASE', database_path('database.sqlite')),
    'prefix' => '',
],

'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    'engine' => null,
],

'pgsql' => [
    'driver' => 'pgsql',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '5432'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'prefix' => '',
    'schema' => 'public',
],

'oracle' => [
    'driver' => 'oracle',
    'host' => env('DB_HOST', '172.16.0.16'),
    'port' => env('DB_PORT', '1521'),
    'database' => env('DB_DATABASE', 'salima'),
    'username' => env('DB_USERNAME', 'TEST'),
    'password' => env('DB_PASSWORD', 'TEST'),
    'charset' => 'AL32UTF8',
    'prefix' => '',
    'schema' => 'public',
],

],

/*

my php.ini:

extension=php_ldap.dll extension=php_mbstring.dll extension=php_exif.dll ; Must be after mbstring as it depends on it extension=php_mysql.dll extension=php_mysqli.dll extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client ;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client extension=php_openssl.dll ;extension=php_pdo_firebird.dll extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll

please help me

0 likes
1 reply
gbryant200's avatar

Did you get this resolved? I'm having a similar issue. Everything works fine from the command line but the OCI8 driver doesn't load for apache/fpm.

I have a Homestead/Laravel Vagrant box. I'm using Apache for my site. I have oci8 installed with version 11.1 of the instant client tools. I have the oci8 extension added to all my php.ini files - apache, cli, cgi and fpm. I have the LD_LIBRARY_PATH and ORACLE_HOME set in fpm's www.conf and in /etc/apache2/envars. I also have an oracle.conf file in /etc/ld.so.conf.d that sets the location of the client library files. The oci8 driver still doesn't load for apache/fpm. It runs fine from the command line. This is driving me crazy. I added the 'extension=oci8' to the php.ini files, not any external .conf file.

Any ideas would be greatly appreciated.

Please or to participate in this conversation.