|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75257 php-fpm restart can't connect to db2
Submitted: 2017-09-26 03:10 UTC Modified: 2018-08-27 10:05 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: yufewell at foxmail dot com Assigned: vnkbabu (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.1Git-2017-09-26 (Git) OS: centos
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
29 + 47 = ?
Subscribe to this entry?

 [2017-09-26 03:10 UTC] yufewell at foxmail dot com
my system is centos 7, web server: nginx 1.10.3, php: 7.1.3 and 5.4.45
and i installed it by oneinstack package.
when i connect to db2 of 1208(UTF-8) codepage, all is fine.
when i connect to db2 of 1386(GBK)codepage, it will return error :
[IBM][CLI Driver] SQL0332N  Character conversion from the source code page "1386" to the target code page "819" is not supported.  SQLSTATE=01539 SQLCODE=-332

if i reboot server machine, this error will gone!!!
and then i restart php-fpm service, the error come back!!!

why server reboot make it work?
why php-fpm restart lead to error?

all i know that is db2 codepage problem, but i can't change db2 server codepage.
so i try to change my cli config, is this right?

i can't google it right, so i write it down here.
maybe it's my problem, maybe it's bug i think.

will somebody help me?

Test script:
it's very sample script

$database = 'test';
$user = 'db2';
$password = '000';
$hostname = '';
$port = 50000;
$constr = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
$conn = db2_connect($constr, '', '');

Expected result:
no patch

Actual result:
no patch


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-26 03:43 UTC] yufewell at foxmail dot com
i have already solve this problem.
it's my fault that not set config right.

just add setlocale(LC_ALL, 'right codepage');
then it's ok!!!

it's my fault but i find it out really hard.
maybe we can make it easy for others!!!
 [2018-08-27 10:05 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: vnkbabu
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 26 03:03:35 2021 UTC