Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lumen: Unsupported driver [db2_ibmi_odbc]. #84

Open
ogind-sbagul opened this issue Nov 23, 2022 · 1 comment
Open

Lumen: Unsupported driver [db2_ibmi_odbc]. #84

ogind-sbagul opened this issue Nov 23, 2022 · 1 comment

Comments

@ogind-sbagul
Copy link

ogind-sbagul commented Nov 23, 2022

As stated above getting Unsupported driver [db2_ibmi_odbc] error for my Lumen project.

Here're the required details:

  • I have PHP v7.4.4 (running on windows), Lumen v8.3.4

  • Have installed both ibm_db2 & pdo_ibm extensions installed

  • Tried with db2_ibmi_ibm driver too, but result is the same

  • My composer.json
    {
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
    "php": "^7.3|^8.0",
    "laravel/lumen-framework": "^8.3.1"
    },
    "require-dev": {
    "fakerphp/faker": "^1.9.1",
    "mockery/mockery": "^1.3.1",
    "phpunit/phpunit": "^9.5.10",
    "cooperl/laravel-db2": "^8.0"
    },
    "autoload": {
    "psr-4": {
    "App\": "app/",
    "Database\Factories\": "database/factories/",
    "Database\Seeders\": "database/seeders/"
    }
    },
    "autoload-dev": {
    "classmap": [
    "tests/"
    ]
    },
    "config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
    "post-root-package-install": [
    "@php -r "file_exists('.env') || copy('.env.example', '.env');""
    ]
    }
    }

  • Driver
    'ibmi' => [
    'driver' => 'db2_ibmi_odbc',
    // or 'db2_ibmi_ibm' / 'db2_zos_odbc' / 'db2_expressc_odbc / 'db2_ibmi_odbc'
    'driverName' => '{IBM i Access ODBC Driver}',
    // or '{iSeries Access ODBC Driver}' / '{IBM i Access ODBC Driver 64-bit}' / '{IBM i Access ODBC Driver}'
    'host' => 'localhost',
    'username' => 'db2',
    'password' => '12345',
    'database' => 'mydb',
    'prefix' => '',
    'schema' => 'default schema',
    'port' => '',
    'date_format' => 'Y-m-d H:i:s',
    // or 'Y-m-d H:i:s.u' / 'Y-m-d-H.i.s.u'...
    'odbc_keywords' => [
    'SIGNON' => 3,
    'SSL' => 0,
    'CommitMode' => 2,
    'ConnectionType' => 0,
    'DefaultLibraries' => '',
    'Naming' => 0,
    'UNICODESQL' => 0,
    'DateFormat' => 5,
    'DateSeperator' => 0,
    'Decimal' => 0,
    'TimeFormat' => 0,
    'TimeSeparator' => 0,
    'TimestampFormat' => 0,
    'ConvertDateTimeToChar' => 0,
    'BLOCKFETCH' => 1,
    'BlockSizeKB' => 32,
    'AllowDataCompression' => 1,
    'CONCURRENCY' => 0,
    'LAZYCLOSE' => 0,
    'MaxFieldLength' => 15360,
    'PREFETCH' => 0,
    'QUERYTIMEOUT' => 1,
    'DefaultPkgLibrary' => 'QGPL',
    'DefaultPackage' => 'A /DEFAULT(IBM),2,0,1,0',
    'ExtendedDynamic' => 0,
    'QAQQINILibrary' => '',
    'SQDIAGCODE' => '',
    'LANGUAGEID' => 'ENU',
    'SORTTABLE' => '',
    'SortSequence' => 0,
    'SORTWEIGHT' => 0,
    'AllowUnsupportedChar' => 0,
    'CCSID' => 819,
    'GRAPHIC' => 0,
    'ForceTranslation' => 0,
    'ALLOWPROCCALLS' => 0,
    'DB2SQLSTATES' => 0,
    'DEBUG' => 0,
    'TRUEAUTOCOMMIT' => 0,
    'CATALOGOPTIONS' => 3,
    'LibraryView' => 0,
    'ODBCRemarks' => 0,
    'SEARCHPATTERN' => 1,
    'TranslationDLL' => '',
    'TranslationOption' => 0,
    'MAXTRACESIZE' => 0,
    'MultipleTraceFiles' => 1,
    'TRACE' => 0,
    'TRACEFILENAME' => '',
    'ExtendedColInfo' => 0,
    ],
    'options' => [
    PDO::ATTR_CASE => PDO::CASE_LOWER,
    PDO::ATTR_PERSISTENT => false
    ]
    + (defined('PDO::I5_ATTR_DBC_SYS_NAMING') ? [PDO::I5_ATTI5_ATTR_DBC_SYS_NAMINGR_COMMIT => false] : [])
    + (defined('PDO::I5_ATTR_COMMIT') ? [PDO::I5_ATTR_COMMIT => PDO::I5_TXN_NO_COMMIT] : [])
    + (defined('PDO::I5_ATTR_JOB_SORT') ? [PDO::I5_ATTR_JOB_SORT => false] : [])
    + (defined('PDO::I5_ATTR_DBC_LIBL') ? [PDO::I5_ATTR_DBC_LIBL => ''] : [])
    + (defined('PDO::I5_ATTR_DBC_CURLIB') ? [PDO::I5_ATTR_DBC_CURLIB => ''] : [])
    ],
    ]

  • Code executed in web.php file
    $router->get('/', function () use ($router) {
    return DB::connection()->getDatabaseName();
    });
    Thank you in advance.

@basavaraj-nanjappa
Copy link

basavaraj-nanjappa commented Mar 11, 2023

Myself too having same issue, though I am using php 8.1 and "cooperl/laravel-db2": "^9.0", in a Ubuntu 22 OS environment

I did several checks, not able to understand why it is not supported, do we need to install any thing else?

I am trying to run the DB2 in a container and my php application in another container

Followed this https://github.com/php/pecl-database-pdo_ibm

@cooperl22 please will you be able to comment or suggest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants