i am running apapche 1.3.20 on a UNiX box with php compiled with freetds 
support fro mssql server.
I have a  MSSQL 7 server I need it to connect to using the php commands. 
When I run an sql script with the mssql_connect function I get the 
following error:
Warning: 0 is not a Sybase link index in / blah/file.php line 13

I looked at the error_log and it said Connection refused, login 
incorrect. Even though the user/pass is correct.

Any help would be apreciated.


this is the configuration I used:
(I was unable to complete step 2, cause running this on an OS X box and 
i dont know where that is here)

Installation Procedure !
 > tar -xzvf freetds-xxx.tgz
 > cd freetds-xxx/
 > ./configure --prefix=/usr/local/ftds --with-tdsver=4.2 --enable-dbmfix
 > make && make install

 > Edit your /etc/ld.so.conf (or equivalant) add /usr/local/ftds/lib to it
 > run ldconfig (located in /sbin/ldconfig in linux)

 > tar -xzvf php-xxx.tar.gz
 > cd php-xxx/
 > edit 'ext/sybase/config.m4', replace 'dbopen' with 'tdsdbopen'
(in version 4.0.6 of PHP this in on line 27 of config.m4)
 > (I am not sure if this step is 100% necessary, but do it anyway!)
edit the 'configure' file and look for PHP_SYBASE_DBOPEN, you should see 
different versions of this. As follows:
#define PHP_SYBASE_DBOPEN tdsdbopen <-- leave this alone
#define PHP_SYBASE_DBOPEN dbopen <-- change this to #define 

 > ./configure [put other php options here] --with-mssql=/usr/local/ftds 
 > make && make install
 > cp php.ini-dist /usr/local/lib/php.ini (the location of this file may 
differ for your installation)

 > Now, edit /usr/local/lib/php.ini file, look for 
'sybase.interface_file' directive
 > uncomment it and change the value to /usr/local/ftds/interfaces 
(location where you installed freeTDS)

 > Edit /usr/local/ftds/interfaces file, for MSSQL, you have to add
an entry like the following*:

query tcp tds4.2 IPADDRESS_OF_SQL_SERVER 1433

* when writing PHP code, use the name "mssqlconnection" for hostname,
so you would use something like:
$conn = "mssqlconnection";
$username = "myuser";
$password = "mypass";
$dbc = mssql_connect ("$conn", "$username", "$password");

PHP Database 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