POSTS
安裝php mssql 模組 使用FreeTDS編譯遇到的問題
freetds-0.82 目前檔案有所變動以致變異上造成錯誤
必須修改
ext/mssql/config.m4
檔案
Revision 1.9.2.2.2 | Revision 1.9.2.2.2.1 | ||
---|---|---|---|
1 | dnl | 1 | dnl |
2 | dnl $Id: config.m4,v 1.9.2.2.2.2 2008/10/04 13:19:22 felipe Exp $ | 2 | dnl $Id: config.m4,v 1.9.2.2.2.1 2007/07/03 17:25:34 sniper Exp $ |
3 | dnl | 3 | dnl |
4 | 4 | ||
5 | PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS, | 5 | PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS, |
6 | [ –with-mssql[=DIR] Include MSSQL-DB support. DIR is the FreeTDS home | 6 | [ –with-mssql[=DIR] Include MSSQL-DB support. DIR is the FreeTDS home |
7 | directory [/usr/local/freetds]]) | 7 | directory [/usr/local/freetds]]) |
8 | 8 | ||
9 | if test “$PHP_MSSQL” != “no”; then | 9 | if test “$PHP_MSSQL” != “no”; then |
10 | 10 | ||
11 | if test “$PHP_MSSQL” = “yes”; then | 11 | if test “$PHP_MSSQL” = “yes”; then |
12 | for i in /usr/local /usr; do | 12 | for i in /usr/local /usr; do |
13 | if test -f $i/include/sybdb.h; then | 13 | if test -f $i/include/tds.h; then |
14 | FREETDS_INSTALLATION_DIR=$i | 14 | FREETDS_INSTALLATION_DIR=$i |
15 | FREETDS_INCLUDE_DIR=$i/include | 15 | FREETDS_INCLUDE_DIR=$i/include |
16 | break | 16 | break |
17 | elif test -f $i/include/freetds/sybdb.h; then | 17 | elif test -f $i/include/freetds/tds.h; then |
18 | FREETDS_INSTALLATION_DIR=$i | 18 | FREETDS_INSTALLATION_DIR=$i |
19 | FREETDS_INCLUDE_DIR=$i/include/freetds | 19 | FREETDS_INCLUDE_DIR=$i/include/freetds |
20 | break | 20 | break |
21 | fi | 21 | fi |
22 | done | 22 | done |
… | … | ||
25 | AC_MSG_ERROR(Cannot find FreeTDS in known installation directories) | 25 | AC_MSG_ERROR(Cannot find FreeTDS in known installation directories) |
26 | fi | 26 | fi |
27 | 27 | ||
28 | elif test “$PHP_MSSQL” != “no”; then | 28 | elif test “$PHP_MSSQL” != “no”; then |
29 | 29 | ||
30 | if test -f $PHP_MSSQL/include/sybdb.h; then | 30 | if test -f $PHP_MSSQL/include/tds.h; then |
31 | FREETDS_INSTALLATION_DIR=$PHP_MSSQL | 31 | FREETDS_INSTALLATION_DIR=$PHP_MSSQL |
32 | FREETDS_INCLUDE_DIR=$PHP_MSSQL/include | 32 | FREETDS_INCLUDE_DIR=$PHP_MSSQL/include |
33 | elif test -f $PHP_MSSQL/include/freetds/sybdb.h; then | 33 | elif test -f $PHP_MSSQL/include/freetds/tds.h; then |
34 | FREETDS_INSTALLATION_DIR=$PHP_MSSQL | 34 | FREETDS_INSTALLATION_DIR=$PHP_MSSQL |
35 | FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds | 35 | FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds |
36 | else | 36 | else |
37 | AC_MSG_ERROR(Directory $PHP_MSSQL is not a FreeTDS installation directory) | 37 | AC_MSG_ERROR(Directory $PHP_MSSQL is not a FreeTDS installation directory) |
38 | fi | 38 | fi |
39 | fi | 39 | fi |
40 | 40 | ||
41 | if test ! -r “$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a” && test ! -r “$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so”; then | 41 | if test ! -r “$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a” && test ! -r “$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so”; then |
42 | AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so]) | 42 | AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so]) |
43 | fi | 43 | fi |
44 | 44 | ||
45 | PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR) | 45 | PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR) |
46 | PHP_ADD_LIBRARY_WITH_PATH(sybdb, $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, MSSQL_SHARED_LIBADD) | 46 | PHP_ADD_LIBRARY_WITH_PATH(sybdb, $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, MSSQL_SHARED_LIBADD) |
47 | 47 |