GithubHelp home page GithubHelp logo

classicvalues / pecl-database-pdo_ibm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from php/pecl-database-pdo_ibm

0.0 1.0 0.0 478 KB

PDO driver for IBM databases

Home Page: http://pecl.php.net/package/pdo_ibm

License: Apache License 2.0

C 39.25% PHP 59.61% M4 1.14%

pecl-database-pdo_ibm's Introduction

PDO_IBM

Interface for PHP to DB2 for z/OS, DB2 for LUW, DB2 for i.

IBM i users

When running on IBM i, PDO_IBM doesn't link with the Db2 LUW client library, but instead with libdb400, which provides a PASE wrapper for SQL/CLI. The differences between SQL/CLI in IBM i and the LUW driver are wrapped for you. You don't need Db2 Connect on IBM i as a result.

To install, make sure you have the new Yum-based OSS environment. Install PHP, plus any dependencies like so:

yum install sqlcli-devel gcc make-gnu

Tony Cairns' replacement libdb400 is not yet tested, but may be desirable due to its greater debugging features.

IBM i users should read tests/README400.txt in order to set up prequisites for unit tests.

LUW/z/Db2 Connect users

CLIDRIVER should be installed in your system. If not installed Download from the below link.

DOWNLOAD CLI DRIVER

PHP should be installed in your system.

How to install php pdo_ibm extension in Linux/Mac

if IBM_DB_HOME and LD_LIBRARY_PATH environment variable not set then set them with installed CLIDRIVER.
(say CLIDRIVER installed at "/home/user/clidriver")

export IBM_DB_HOME=/home/user/clidriver 
export LD_LIBRARY_PATH=/home/user/clidriver/lib

1) pecl install pdo_ibm
        
2) Open the php.ini file in an editor of your choice. Edit the extension entry in the
   php.ini file in the <local_php_directory>/php/lib directory to reference the PHP driver:
       extension=pdo_ibm.so
       
3) Ensure that the PHP driver can access the libdb2.so CLI driver file by
   setting the LD_LIBRARY_PATH variable for Linux and UNIX operating systems
   other than the AIX® operating system. For AIX operating system, you must set LIBPATH variable. 

4) Optional: If the PHP application that is connecting to an IBM database server is running ini
   the HTTP server environment, add the LD_LIBRARY_PATH variable in the httpd.conf file.

How to install php pdo_ibm extension in Windows

Set CLIDRIVER\bin path to PATH environment variable.

set PATH=<CLIDRIVER installed path>\bin;%PATH%

1. Download the php_pdo_ibm DLLs for PHP 7.x(7.0, 7.1, 7.2) from below link.
      https://github.com/ibmdb/php_ibm_db2
	  

2. Open the php.ini file in an editor of your choice. Edit the extension entry in the
   php.ini file in the <local_php_directory>\php\lib directory to reference the PHP driver:
	  extension=php_pdo_ibm

How to run sample program

connect.php:-

<?php
        $db = null;
        $dsn = "ibm:<DSN NAME>";
        $user = "<USER>";
        $pass = "<PASSWORD>";

        $pdo = new PDO($dsn, $user, $pass);
        if ($pdo)
           print "Connection Successful.\n";

?>


To run the sample:- php connect.php

Contributing:

See CONTRIBUTING.md

The developer sign-off should include the reference to the DCO in defect remarks(example below):
DCO 1.1 Signed-off-by: Random J Developer <[email protected]>

pecl-database-pdo_ibm's People

Contributors

nattynarwhal avatar rlerdorf avatar abhi7436 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.