Db2 (On Premises and Cloud)

Expand all | Collapse all

php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

  • 1.  php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Thu July 02, 2020 02:54 AM
    Hi,

    I am looking for php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5 running on Windows 10 (64 bit).

    Tried the one posted here but they are not working:  https://github.com/ibmdb/php_ibm_db2/tree/master/PHP%207.4.x/x64/TS

    Getting this error message:

    PHP Startup: Unable to load dynamic library 'ibm_db2' (tried: C:\\xampp\\php\\ext\\ibm_db2 (The specified module could not be found.), C:\\xampp\\php\\ext\\php_ibm_db2.dll (%1 is not a valid Win32 application.)) in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_ibm' (tried: C:\\xampp\\php\\ext\\pdo_ibm (The specified module could not be found.), C:\\xampp\\php\\ext\\php_pdo_ibm.dll (%1 is not a valid Win32 application.)) in Unknown on line 0

    Thanks.

    ------------------------------
    Gagan Kakkar
    ------------------------------


  • 2.  RE: php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Thu July 02, 2020 07:28 AM
    Hi Gagan,

    I have installed php 7.4.7 and copied php_ibm_db2-master\PHP 7.4.x\x64\TS\php_ibm_db2.dll.
    Added it to php.ini and can connect successfully.

    As I suggested earlier, the problem seem to be specific to your environment and looks like you have a mismatch of 32-bit/64-bit environment.
    Check your PATH settings, and correct it.

    If I copy the 32-bit DLL to ext, I get same error as yours:

    C:\IBM Last TP Backup\workplace\php>php connect.php
    PHP Warning: PHP Startup: Unable to load dynamic library 'php_ibm_db2.dll' (tried: C:\php\ext\php_ibm_db2.dll (%1 is not a valid Win32 application.), C:\php\ext\php_php_ibm_db2.dll.dll (The specified module could not be found.)) in Unknown on line 0

    Warning: PHP Startup: Unable to load dynamic library 'php_ibm_db2.dll' (tried: C:\php\ext\php_ibm_db2.dll (%1 is not a valid Win32 application.), C:\php\ext\php_php_ibm_db2.dll.dll (The specified module could not be found.)) in Unknown on line 0
    PHP Fatal error: Uncaught Error: Call to undefined function db2_connect() in C:\IBM Last TP Backup\workplace\php\connect.php:7
    Stack trace:
    #0 {main}
    thrown in C:\IBM Last TP Backup\workplace\php\connect.php on line 7

    Fatal error: Uncaught Error: Call to undefined function db2_connect() in C:\IBM Last TP Backup\workplace\php\connect.php:7
    Stack trace:
    #0 {main}
    thrown in C:\IBM Last TP Backup\workplace\php\connect.php on line 7

    Thanks,
    Amar

    ------------------------------
    Amarnath Reddy
    ------------------------------



  • 3.  RE: php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Fri July 03, 2020 07:11 AM
    Edited by Gagan Kakkar Tue May 18, 2021 02:47 AM

    Hi Amar,

    Thank you for your reply.

    I checked the version/path etc. can't find out where 32/64-bit mistmatch could be.

    C:\Users\Gagan>php -version
    PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 )
    Copyright (c) The PHP Group

    phpinfo

    Path:

    C:\app\Gagan\product\18.0.0\dbhomeXE\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\Gagan\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\Gagan\AppData\Local\Programs\Python\Python38\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Java\jdk1.8.0_251\bin;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files (x86)\HTML Help Workshop;C:\Users\Gagan\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\sqlite;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files (x86)\AOMEI\AOMEI Backupper 5.7.0;C:\Program Files (x86)\Micro Focus\Visual COBOL\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\CA\Gen86Free\Gen\;C:\Program Files (x86)\CA\Gen86Free\;C:\Oracle\instantclient_19_6;C:\Program Files\PostgreSQL\12\bin;C:\Program Files\PowerShell\7\;C:\xampp\php;C:\Program Files\IBM\SQLLIB\clidriver\bin;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\dotnet\;C:\Users\Gagan\AppData\Local\Microsoft\WindowsApps;C:\Users\Gagan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Gagan\AppData\Roaming\npm


    Thanks.



    ------------------------------
    Gagan Kakkar
    ------------------------------



  • 4.  RE: php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Tue May 18, 2021 03:04 AM
    Hi,
    I never got this working. Why won't IBM provide the compatible DLLs with every release ?

    Thanks.

    ------------------------------
    Gagan Kakkar
    ------------------------------



  • 5.  RE: php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Tue May 18, 2021 12:23 PM
    Hi Amar,

    Can you please help me working on it from last one week. Please tell me how you fixed it. That would be a great help to me.
    ........please.

    Thanks and Regards
    Krishna

    ------------------------------
    Narasimha Nannuri
    ------------------------------



  • 6.  RE: php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Tue May 18, 2021 12:23 PM
    Hi,

    I am too facing the same problem. Can you please share here. How you solved this problem.
    I thinks your is a 64 bit architecture

    Thanks and regards
    Krishna

    ------------------------------
    Narasimha Nannuri
    ------------------------------



  • 7.  RE: php_ibm_db2 & php_pdo_ibm drivers for PHP 7.4.5

    Posted Tue May 18, 2021 12:23 PM
    Hi ,

    I am too trying with the same github but not working out can some one please able to help me?

    PS C:\Users\db2admin.DESKTOP-AK10ES5.000\Desktop\sample> php -f .\db2conn.php
    PHP Warning: PHP Startup: Unable to load dynamic library 'php_ibm_db2.dll' (tried: ext\php_ibm_db2.dll (The specified module could not be found.), ext\php_php_ibm_db2.dll.dll (The specified module could not be found.)) in Unknown on line 0

    Warning: PHP Startup: Unable to load dynamic library 'php_ibm_db2.dll' (tried: ext\php_ibm_db2.dll (The specified module could
    not be found.), ext\php_php_ibm_db2.dll.dll (The specified module could not be found.)) in Unknown on line 0
    Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(
    PHP Warning: odbc_connect(): SQL error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "127.0.0.1". Communication function detecting the error: "connect". Protocol specific error code(s): "10061", "*", "*". SQLSTATE=08001
    , SQL state 08001 in SQLConnect in C:\Users\db2admin.DESKTOP-AK10ES5.000\Desktop\sample\db2conn.php on line 33

    Warning: odbc_connect(): SQL error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "127.0.0.1". Communication function detecting the error: "connect". Protocol specific error code(s): "10061", "*", "*". SQLSTATE=08001
    , SQL state 08001 in SQLConnect in C:\Users\db2admin.DESKTOP-AK10ES5.000\Desktop\sample\db2conn.php on line 33

    Thanjs and Regards
    Krishna

    ------------------------------
    Narasimha Nannuri
    ------------------------------