Db2

 View Only

ext\php_php_ibm_db2.dll.dll IBM db2

  • 1.  ext\php_php_ibm_db2.dll.dll IBM db2

    Posted Tue May 18, 2021 12:23 PM
    Hi,
    I am trying to communicate with DB2 using php.

    When i try to run the php -f .\db2conn.php.
    I am getting the error bewlow.
    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).

    My code is here
    <?php

    $database = "SAMPLE";        # Get these database details from
    $hostname = "localhost";     # the web console
    $user     = "db2admin";   #
    $password = "admin";    #
    $port     =  50000;          #
    $ssl_port = 50001;          #

    # Build the connection string
    #
    $driver  = "DRIVER={IBM DB2 ODBC DRIVER};";
    $dsn     = "DATABASE=$database" .
               "HOSTNAME=$hostname" .
               "PORT=$port" .
               "PROTOCOL=TCPIP " .
               "UID=$user" .
               "PWD=$password" .
               "DB2INSTANCE=db2inst1";
    $ssl_dsn = "DATABASE=$database; " .
               "HOSTNAME=$hostname;" .
               "PORT=$ssl_port; " .
               "PROTOCOL=TCPIP; " . 
               "UID=$user;" . 
               "PWD=$password;" . 
               "SECURITY=SSL;" .
               "DB2INSTANCE=db2inst1";
    $conn_string = $driver . $dsn;     # Non-SSL
    $conn_string = $driver . $ssl_dsn# SSL

    # Connect
    #
    $conn = odbc_connect$conn_string"""");
    if$conn )
    {
        echo "Connection succeeded.";

        # Disconnect
        #
        odbc_close$conn );
    }
    else
    {
        echo "Connection failed.";
    }
    ?>


    Any one have faced this problem.

    I verified all the configuration version control .dll . But not working out.

    But what my understanding till now is. php is searching for the is searching for ext\php_php_ibm_db2.dll.dll instead of php_ibm_db2.dll.

    Can some able to help me in the group. 

    Thanks in advance.






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

    #Db2