php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44991 [PATCH] Compile Failure With freetds0.82
Submitted: 2008-05-14 05:08 UTC Modified: 2008-10-04 13:21 UTC
Votes:12
Avg. Score:4.5 ± 0.9
Reproduced:11 of 11 (100.0%)
Same Version:8 (72.7%)
Same OS:1 (9.1%)
From: scourgen at gmail dot com Assigned:
Status: Closed Package: MSSQL related
PHP Version: 5.2.6 OS: Centos5.1(k2.6.18)
Private report: No CVE-ID: None
 [2008-05-14 05:08 UTC] scourgen at gmail dot com
Description:
------------
compile failure with freetds version 0.82(no tds.h,libtds.so)

Reproduce code:
---------------
configure:
./configure  --with-mssql=/usr/local/freetds  

Expected result:
----------------
configure: error: Directory /usr/local/freetds is not a FreeTDS installation directory

Actual result:
--------------
there is no tds.h,libtds.so in freetds install directory(just in freetds version 0.82)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-29 20:09 UTC] brodie at mcw dot edu
I have the same issue--  note, this problem is due to that the freetds environment NO LONGER PROVIDES tds.h, or libtds.so.   This is a total re-design of freetds, and as such, completely breaks the ability of php to use the -with-mssql option.

The re-design of FreeTDS as outlined above was as of version 0.82.

As documented, the --with-mssql=[freetds dir] will fail, and will complain that the directory is not a freeTDS directory.
 [2008-06-12 00:19 UTC] jklowden at freetds dot org
This diff is what you want.  --jkl

--- config.m4-new	2008-06-11 20:13:47.000000000 -0400
+++ config.m4	2007-07-03 13:25:34.000000000 -0400
@@ -10,11 +10,11 @@
 
   if test "$PHP_MSSQL" = "yes"; then
     for i in /usr/local /usr; do
-      if test -f $i/include/sybdb.h; then
+      if test -f $i/include/tds.h; then
         FREETDS_INSTALLATION_DIR=$i
         FREETDS_INCLUDE_DIR=$i/include
         break
-      elif test -f $i/include/freetds/sybdb.h; then
+      elif test -f $i/include/freetds/tds.h; then
         FREETDS_INSTALLATION_DIR=$i
         FREETDS_INCLUDE_DIR=$i/include/freetds
         break
@@ -27,10 +27,10 @@
 
   elif test "$PHP_MSSQL" != "no"; then
 
-    if test -f $PHP_MSSQL/include/sybdb.h; then
+    if test -f $PHP_MSSQL/include/tds.h; then
       FREETDS_INSTALLATION_DIR=$PHP_MSSQL
       FREETDS_INCLUDE_DIR=$PHP_MSSQL/include
-    elif test -f $PHP_MSSQL/include/freetds/sybdb.h; then
+    elif test -f $PHP_MSSQL/include/freetds/tds.h; then
       FREETDS_INSTALLATION_DIR=$PHP_MSSQL
       FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds
     else
@@ -38,8 +38,8 @@
     fi
   fi  
 
-  if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && 
test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
-     AC_MSG_ERROR(Could not find 
$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so])
+  if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a" && 
test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so"; then
+     AC_MSG_ERROR(Could not find 
$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so])
   fi
 
   PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR)
 [2008-07-16 07:56 UTC] matthias at dsx dot at
same on gentoo linux...
http://bugs.gentoo.org/show_bug.cgi?id=223891 (freetds bug)
 [2008-07-16 18:59 UTC] hoffie at gentoo dot org
I can confirm that above patch makes it possible to compile php-5.2.6 against both freetds-0.64 (i.e. it does not break backward compatibility) and freetds-0.82 (i.e. it works with recent versions).

You can find a whitespace-fixed (bug tracker screwed it up) and direction-fixed (patch had to be applied using -R) version of the patch here: http://overlays.gentoo.org/proj/php/browser/patches/php-patches/5.2.6/php5/mssql-freetds-compat.patch?rev=3485
Credits should still go to jklowden at freetds dot org.

Any way to get this patch in, especially since it does not seem to break backwards compatibility?
 [2008-07-17 10:03 UTC] hoffie at gentoo dot org
Updated patch which covers ext/pdo_dblib as well:
http://overlays.gentoo.org/proj/php/browser/patches/php-patches/5.2.6/php5/freetds-compat.patch?rev=3488

Done by matthias at dsx dot at.
 [2008-07-26 06:54 UTC] seikath at gmail dot com
workarround for : there is no tds.h,libtds.so in freetds install 
directory

slackware 12.1 , freetds-0.82, php-5.2.6
freetds-0.82 ./configure --prefix=/usr/local/freetds ;make; make install
then 
cp freetds-0.82/src/tds/.libs/libtds.a  libtds.a  /usr/lib/libtds.a 
then you may go further ...
php ./configure --with-mssql  etc
 [2008-10-04 13:21 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.2, 5.3 and HEAD.

Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC