[unixODBC-support] symbol lookup error: /usr/lib/php/extensions/unixODBC.so: undefined symbol: SQLAllocEnv

Brian Schonecker Brian.Schonecker at Xtek.com
Mon Mar 31 15:16:33 BST 2008


I've built a SuSE 9.3 professional "minimal installation" system from scratch.  I made sure that the unixODBC RPM was _not_ installed with the setup.

I downloaded, configured and compiled unixODBC (via CVS) successfully and have created three ODBC.INI DSN's and they all work (not at the same time, however) via 'isql -v DSN'.

I've got apache2 with PHP4 up and running and a phpinfo(); works just fine but when I try to connect to an external database I get the following error in my apache error_log:

<snip>
/usr/sbin/httpd2-prefork: symbol lookup error: /usr/lib/php/extensions/unixODBC.so: undefined symbol: SQLAllocEnv
<snip>

Here's my .php file for ODBC connection.

<?php

$database = 'prod';
$dsn      = 'PROD';   
$user     = 'pass;
$password = "pass";

echo "Try to connect<br>";

$connection = odbc_connect($dsn,$user,$password,SQL_CUR_USE_ODBC);

$_SQL = " select SYSDATE FROM DUAL ";

echo "prepare the statement<br>";

if ($result1 = odbc_prepare($connection,$_SQL)) {

    echo ("statment prepared<br>".$_SQL."<br>");
              }
              else { odbc_error($connection);
               echo "error on prepare!";

    }
  echo " prepared<br>";

  $result1 = odbc_exec($connection,$_SQL) or die (odbc_error());

  echo "WOO HOO!";
  $cnt = 0;
  while (($cnt<10 ) && (odbc_fetch_row($result1))) {

      echo odbc_result($result1,1)."<br>";
      $cnt++;
        }

  echo "WOO HOO!";
  phpinfo();

?>


The code works just fine on another server, but that one is dying and I need to replace it.


As you can see, the 'isql' command from BASH works just fine. :

linux:~ # isql -v prod pass pass
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select sysdate from dual;
+--------------------+
| SYSDATE            |
+--------------------+
| 2008-03-31 10:12:08|
+--------------------+
SQLRowCount returns -1
1 rows fetched
SQL> 




Anyone know why apache2 'crashes' on this?  I've verified that unixODBC.so is in the correct directory.

I've done this before and documented my work but for some reason I can't figure out what's wrong.


Here's some info that may/may not be helpful:

linux:/srv/www/htdocs # rpm -qa | grep apache | sort
apache2-2.0.53-9
apache2-doc-2.0.53-9
apache2-example-pages-2.0.53-9
apache2-mod_php4-4.3.10-14.4
apache2-prefork-2.0.53-9

linux:/srv/www/htdocs # rpm -qa | grep php | sort
apache2-mod_php4-4.3.10-14.4
php-doc-5.0.3-3
php4-4.3.10-14.4
php4-bcmath-4.3.10-14
php4-bz2-4.3.10-14
php4-calendar-4.3.10-14
php4-ctype-4.3.10-14
php4-curl-4.3.10-14
php4-dbase-4.3.10-14
php4-dbx-4.3.10-14
php4-domxml-4.3.10-14
php4-exif-4.3.10-14.4
php4-filepro-4.3.10-14
php4-ftp-4.3.10-14
php4-gd-4.3.10-14
php4-gettext-4.3.10-14
php4-gmp-4.3.10-14
php4-iconv-4.3.10-14
php4-imap-4.3.10-14
php4-ldap-4.3.10-14
php4-mbstring-4.3.10-14
php4-mcal-4.3.10-14
php4-mcrypt-4.3.10-14
php4-mhash-4.3.10-14
php4-mime_magic-4.3.10-14
php4-mysql-4.3.10-14
php4-pear-4.3.10-14
php4-pgsql-4.3.10-14
php4-qtdom-4.3.10-14
php4-session-4.3.10-14.4
php4-shmop-4.3.10-14
php4-snmp-4.3.10-14
php4-sockets-4.3.10-14
php4-swf-4.3.10-14
php4-sysvsem-4.3.10-14
php4-sysvshm-4.3.10-14.4
php4-wddx-4.3.10-14
php4-xslt-4.3.10-14
php4-yp-4.3.10-14
php4-zlib-4.3.10-14
linux:/srv/www/htdocs # 





More information about the unixODBC-support mailing list