Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have connected an openSUSE LAMP and an Ubuntu LAMP server to DB2 using ODBC. The openSUSE system we're using for a development environment, and the final deployment is to be on the Ubuntu system. On Ubuntu we get segfaults when SQL statements return nulls (see links to related bug reports), but this does not happen on openSUSE. Both machines are running 64-bit, here are the versions of both boxes and their software:

OS         Version    Kernel                Apache    PHP
openSUSE   12.2       3.4.11-2.16-default   2.2.22    5.3.15
Ubuntu     11.04      2.6.38-11-server      2.2.17    5.3.22-1~dotdeb.0
                                       (upgraded from 5.3.5-1ubuntu7)


Reading the changelog on it looked like the bug was fixed in 5.3.11 but upgrading still has not solved our issue. I have finally compared phpinfo() output from both servers line-by-line and found one portion that seems like a red flag, but no idea how to fix this. In the ODBC section the ODBC_LFLAGS option shows:

openSUSE     -L/usr/lib64
Ubuntu       -L/usr/lib

Both systems are 64-bit, and are configured to use the 64-bit version of iSeriesAccess and unixODBC. iSeriesAccess had to be converted from RPM using alien as IBM doesn't support Ubuntu. Unfortunately upgrading Ubuntu or switching distros are not options for us. How can I switch Ubuntu to use /usr/lib64 for ODBC_LFLAGS? Also is there any other problem I may have overlooked?

share|improve this question
Did you find a solution to this problem? I am having the same issue with PHP 5.5.12 and unixODBC 2.3 on Ubuntu 14.10 64bit. I am also having the same problem on Windows 7 64 bit. I have managed to trace it to PDOExecute, but cannot get any further than that. The SQL query I'm using is a guaranteed result containing 4 columns with max length of 15 chars. The unixODBC log shows the SQL being executed and the parameters being passed to it, but then it seg faults. – Paul Taylor Oct 29 '14 at 22:59
No, we're actually running in production with this bug. Our solution was to coalesce every field, which obviously isn't ideal. We're also not using PDO. As I said though, it's only when the statement returns nulls, otherwise everything runs fine. – MaKR Oct 30 '14 at 21:55
Wellp... After distro upgrading to openSUSE 13.2 I still had working ODBC, then after a hard drive crash and fresh install I have this problem on the originally working machine. Revisiting those bug reports I found this link: That's the best fix out there, but you'll have to edit php_odbc's source. Someone else has said that the new IBM i Access Client Solutions works, see… I'll try this and post results. – MaKR Apr 9 '15 at 16:30
It worked to fix openSUSE, now to try on that Ubuntu install.... sadly it's the same 11.04 install of Ubuntu. – MaKR Apr 9 '15 at 18:26
Due to bureocracy this hasn't been done yet, found out today that on Sunday they're upgrading to 14.04 LTS. My coworker has gotten this running on 14.04 already so I expect success, and the world will never know if 11.04 would have worked. I think we can finally close this. – MaKR Apr 30 '15 at 18:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.