DB2 Support for Gallery 2
Gallery 2 supports DB2 UDB V9.x for Linux/UNIX/Windows as database backend.
- Requires a minimum of DB2 Version 9.1 and the 'ibm_db2' PECL PHP extension version 1.2.0. On Linux or UNIX operating systems, install the latest version of the ibm_db2 extension using the "pecl install ibm_db2" command. On Windows, precompiled binaries for ibm_db2 are available from "http://pecl4win.php.net/ext.php/php_ibm_db2.dll".
Database Creation Steps (Before running the Installer)
- The DB2 database for G2 must use a page size of 32 Kb (which is most easily specified at database creation time), and be created to use a Unicode codeset (which must be specified at database creation time). For example, you could use the DB2 CLP command:
db2 "CREATE DATABASE gallery2 USING CODESET UTF-8 TERRITORY US PAGESIZE 32 K"
(The territory 'US' could be any territory code supported by DB2. See the DB2 documentation for a list of supported territory codes: http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/r0004565.htm)
- The database user must have (or be granted) DBADM authority on the database. For example, assuming 'g2user' is the account that Gallery will use (you will specify this account later during Step 5 of the Installer):
db2 "CONNECT TO gallery2"
db2 "GRANT DBADM ON DATABASE TO g2user"
db2 "CONNECT RESET"
UTF-8 Codeset Considerations
The Gallery application uses codepage UTF-8, which is why that codeset is specified in the CREATE DATABASE statement shown above. But, just because Gallery uses that codeset, it is not automatic that the DB2 client does. If the codepage of your DB2 client's operating system is not UTF-8, it will be necessary for you to configure your DB2 client to use that codepage. See "Application code page" as described in the DB2 documentation at http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.sql.doc/doc/c0006825.htm for more details.
Version Requirement History
- Up to G2.2.1, the wrong requirements were communicated. IBM DB2 v8.2 was said to be required, when it actually required v9 or later.
- In G2.2.2, the requirement was changed to v9 or later. No code was changed, but the Gallery team discovered that G2 was using SQL that required IBM DB2 v9 all along (ALTER TABLE DROP COLUMN).