Bug #6505 Updated: apache fails with php4 & freetds
| From: | joey@php.net | Date: | Fri, 04 May 2001 10:43:26 +0000 |
| Subject: | Bug #6505 Updated: apache fails with php4 & freetds | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-53791@lists.php.net to get a copy of this message | ||
ID: 6505
Updated by: joey
Reported By: vaughan@ucla.edu
Status: Closed
Bug Type: Sybase (dblib) related
PHP Version: 4.0 Latest CVS (02/09/2000)
Assigned To:
Comments:
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.
Previous Comments:
---------------------------------------------------------------------------
[2001-05-02 18:45:07] vaughan@ucla.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
/ext/sybase/php_sybase_db.c
to replace all three occurrences of "dbopen" with "tdsdbopen".
---------------------------------------------------------------------------
[2001-05-02 16:18:29] vlad@php.net
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] joey@php.net
This is dblib, not ctlib
---------------------------------------------------------------------------
[2000-09-02 15:37:59] vaughan@ucla.edu
see also bug report # 6069.
---------------------------------------------------------------------------
[2000-09-02 15:32:11] vaughan@ucla.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
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.
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=6505&edit=2