php.net |  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
Votes:2
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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yufewell at foxmail dot com
New email:
PHP Version: OS:

 

 [2017-09-26 03:10 UTC] yufewell at foxmail dot com
Description:
------------
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 = '127.0.0.1';
$port = 50000;
$constr = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
  "HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;";
$conn = db2_connect($constr, '', '');



Expected result:
----------------
no patch

Actual result:
--------------
no patch

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] vnkbabu@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: vnkbabu
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 23:01:23 2020 UTC