Skip to Content.
Sympa Menu

freetds - Re: FreeTDS with PHP connect problems

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Gerry <gerry AT ship-to-order.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: FreeTDS with PHP connect problems
  • Date: Thu, 22 Feb 2001 19:55:27 -0700


I've solved my problem and I thought I'd post the solution here in case others had the same problem. The problem was that in the PHP call to dbopen, it was calling the DBM version of dbopen rather than the FreeTDS version. Perhaps this only happens if you compile in certain other options with PHP that use the DBM calls. In dblib.c I see that there is an #ifdef DBMFIX which renames dbopen to tdsdbopen if it's defined. However, rather than just renaming the function to tdsdbopen, I left dbopen untouched and made a new function tdsdbopen which does the same thing as dbopen. I didn't just want to rename it because I didn't want to break other programs that were already working and calling dbopen. Then in the PHP source, I changed all the calls to dbopen to tdsdbopen. Have others not experienced this same problem? Seems like it would be a common problem.

Gerry

I'm using FreeTDS with PHP4 trying to connect to SQL Server 7. The libraries are working fine as I've written a lot of C code using them. I've compiled freetds into PHP according to the instructions. However, with PHP, every call to mssql_connect fails. It's as if it can't see my interfaces file (my only guess anyway), but I do have:

sybase.interface_file = "/usr/local/freetds/interfaces"

in my php.ini file. Might anyone be able to offer me further guidance?






Archive powered by MHonArc 2.6.24.

Top of Page