|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6505 apache fails with php4 & freetds
Submitted: 2000-09-02 15:32 UTC Modified: 2001-05-04 06:43 UTC
From: vaughan at ucla dot edu Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 4.0 Latest CVS (02/09/2000) OS: Debian 2.2.16
Private report: No CVE-ID: None
 [2000-09-02 15:32 UTC] vaughan at ucla dot edu
I am trying to compile using freetds to eventually access an MS SQL server.

for freetds (v.0.5)

./configure --prefix=/usr/local/freetds/ --enable-msdblib --with-tdsver=4.2

for php 4 (latest CVS 2/9/2000)
 ./configure --with-apxs --with-mysql --enable-track-vars --with-config-file-path=/etc/php4/apache --with-sybase=/usr/local/freetds

export SYBASE=/usr/local/freetds

I edited the /usr/local/freetds/interfaces file to set up the MS SQL server address.  I fixed httpd.conf to have the sybase interfaces file be /usr/local/freetds/interfaces

when I stop apache and run 
apachectl configtest

I get the following output

Syntax error on line 108 of /etc/apache/httpd.conf:
Cannot load /usr/lib/apache/1.3/ into server: /usr/lib/apache/1.3/ undefined symbol: DBSETLCHARSET

Brian Bruns, the author of freetds, suggested a library problem and attempting to fix it by exporting the SYBASE and LD_LIBRARY_PATH variables.  But this does not work.

The only place in the source that I can find DBSETLCHARSET is in file
at line 354:
 but I don't know enough about programming to figure out what sybase.login and charset are needed here, or even to know if this is the offending line.

thanks for any help you can give me.  I have been trying for a long time to find a reliable way to send queries from PHP to a Microsoft SQL server that resides on another machine and to which I only have read access.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-02 15:37 UTC] vaughan at ucla dot edu
see also bug report # 6069.
 [2000-12-06 21:43 UTC]
This is dblib, not ctlib
 [2001-05-02 16:18 UTC]
Looks like since setting the charset is not often used, it is a bug in the library that went unnoticed. Here is an idea:

Patch your include/sybdb.h for FreeTDS. The patch is a one-liner (against version 0.51):

--- old.h       Wed Oct 18 19:35:34 2000
+++ sybdb.h     Wed May  2 13:15:42 2001
@@ -298,6 +298,7 @@
 extern RETCODE    DBSETLUSER(LOGINREC *login, char *username);
 extern RETCODE    DBSETLHOST(LOGINREC *login, char *hostname);
 extern RETCODE    DBSETLAPP(LOGINREC *login, char *application);
+extern  RETCODE    DBSETLCHARSET(LOGINREC *login, char *charset);
 #ifdef DBMFIX
 extern DBPROCESS *tdsdbopen(LOGINREC *login,char *server);

If you succeed, please, report this to the author of FreeTDS, and close the bug report.
 [2001-05-02 18:45 UTC] vaughan at ucla dot edu
probably should close the report, though I have not tried the patch.  The newer versions of FreeTDS and PHP work, so long as (per the Spanish contribution to the mssql_connect section of the manual), I edit


to replace all three occurrences of "dbopen" with "tdsdbopen".

 [2001-05-04 06:43 UTC]
I realize this is a closed bug, but I think it is appropriate
to note here that thanks to Vlad, the last comment here is
no longer required. See bug #8126 for details.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 04:01:28 2024 UTC