ID: 6505
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Closed
Bug Type: Sybase (dblib) related
Description: apache fails with php4 & freetds

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

/ext/sybase/php_sybase_db.c

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



Previous Comments:
---------------------------------------------------------------------------

[2001-05-02 16:18:29] [EMAIL PROTECTED]
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);
 #else

If you succeed, please, report this to the author of FreeTDS, and close the bug report.

---------------------------------------------------------------------------

[2000-12-06 21:43:09] [EMAIL PROTECTED]
This is dblib, not ctlib

---------------------------------------------------------------------------

[2000-09-02 15:37:59] [EMAIL PROTECTED]
see also bug report # 6069.

---------------------------------------------------------------------------

[2000-09-02 15:32:11] [EMAIL PROTECTED]
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
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$SYBASElib

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/libphp4.so into server: 
/usr/lib/apache/1.3/libphp4.so: 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
ext/sybase/php_sybase_db.c
at line 354:
 DBSETLCHARSET(sybase.login,charset);
 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.







---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=6505


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to