Topic
  • 2 replies
  • Latest Post - ‏2009-01-30T01:12:18Z by HenriHoffmann
HenriHoffmann
HenriHoffmann
4 Posts

Pinned topic DB2 MAC OSX & PHP/ODBC

‏2009-01-26T18:05:49Z |
Hi,

I would like to do PHP with DB2 on my Macbook, have to develop some stuff with DB2 and Apache (later for z/OS).
How to configure a PHP/ODBC connection?

By the way, excelent to get DB2 on Mac, so I can move away from mysql.

One more:

Got security problems, even user is in group staff and I granted the user as DBADM. Instance user works fine, Userid is in lowercase, HFS+ w/o case sensitivity.

db2 => connect to sa
SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR
PASSWORD INVALID"). SQLSTATE=08001

Thanks a lot

Henri
Updated on 2009-01-30T01:12:18Z at 2009-01-30T01:12:18Z by HenriHoffmann
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: DB2 MAC OSX & PHP/ODBC

    ‏2009-01-28T21:35:20Z  
    Hi Henri,

    I tried installing the php module for db2 (http://ie.php.net/manual/en/book.ibm-db2.php)
    Unfortunately the installer complained about missing libraries although they do exist.

    You need to recompile php en enable the module with compile flags.
    Some instructions here -> http://www.ibm.com/developerworks/forums/thread.jspa?threadID=247857&tstart=15
    Note that --prefix=/usr tells the installer where to place the php and you might overwrite apples version, I don't know what happens when an update is released. Maybe next time I install it in /usr/local
    About the connect error, did you do a root or standard user install?
    I did a standard user install and found I needed to enable OS Security for DB2, there is a script that does this but:
    a. Can't remember the name
    b. It does a check for some files that don't exist on OSX and aborts. I had to change the script to mark this test true. Then I was able to connect with a different user.
  • HenriHoffmann
    HenriHoffmann
    4 Posts

    Re: DB2 MAC OSX & PHP/ODBC

    ‏2009-01-30T01:12:18Z  
    Hi Henri,

    I tried installing the php module for db2 (http://ie.php.net/manual/en/book.ibm-db2.php)
    Unfortunately the installer complained about missing libraries although they do exist.

    You need to recompile php en enable the module with compile flags.
    Some instructions here -> http://www.ibm.com/developerworks/forums/thread.jspa?threadID=247857&tstart=15
    Note that --prefix=/usr tells the installer where to place the php and you might overwrite apples version, I don't know what happens when an update is released. Maybe next time I install it in /usr/local
    About the connect error, did you do a root or standard user install?
    I did a standard user install and found I needed to enable OS Security for DB2, there is a script that does this but:
    a. Can't remember the name
    b. It does a check for some files that don't exist on OSX and aborts. I had to change the script to mark this test true. Then I was able to connect with a different user.
    Hi willem1,

    thanks a lot for your response.

    About the connect error, did you do a root or standard user install?
    I did a standard user install and found I needed to enable OS Security for DB2, there is a script that does this but:

    -> It's a root install. I did a couple of tests,
    defined a userid "testtest" - > jdbc authentification was fine
    defined a userid "testtest1" -> " , go the error code
    Both userids where defined in group "staff" -> (SYSADM_GROUP) = STAFF, have granted dbadm too, same problem.

    You need to recompile php en enable the module with compile flags.
    Some instructions here -> http://www.ibm.com/developerworks/forums/thread.jspa?threadID=247857&tstart=15
    Note that --prefix=/usr tells the installer where to place the php and you might overwrite apples version, I don't know what happens when an update is released. Maybe next time I install it in /usr/local

    -> I found this before I wrote my post, after I complied the stuff, I got 32/64 bit problems, loading libexec/apache2/libphp5.so (want to use it in HTML pages). Apache2 is 64 bit in Leopard, as much as I know.

    Original module:
    macbookpro:Apache2 db2$ cd /usr
    macbookpro:usr db2$ file libexec/apache2/libphp5.so
    libexec/apache2/libphp5.so: Mach-O universal binary with 4 architectures
    libexec/apache2/libphp5.so (for architecture ppc7400): Mach-O bundle ppc
    libexec/apache2/libphp5.so (for architecture ppc64): Mach-O 64-bit bundle ppc64
    libexec/apache2/libphp5.so (for architecture i386): Mach-O bundle i386
    libexec/apache2/libphp5.so (for architecture x86_64): Mach-O 64-bit bundle x86_64

    Build module was 32 bit only. Maybe I missed something ...
    Later I tried to use PHP via ODBC (get OpenLinks OBDC driver running), but even JDBC worked fine with the instance userid (DB2),
    each ODBC connect got the connection error.

    Thanks a lot in advance

    Henri