[thelist] [MSSQL] - connection from PHP

Paul Bennett paul at teltest.com
Sun Sep 14 21:44:38 CDT 2003


I have a webserver trying to connect to an SQL Server.
The SQL Server in question is SQL Server 2000 and the webserver is 
running php 4.3.1
I have installed freetds to use to natively "talk" to the SQL Server and 
MSSQL support has been compiled into the PHP engine
The SQL Server has been configured to allow mixed-mode security, thus 
allowing access (theoretically) with server ip, port, username and password.
I am working remotely from both server installations and the server 
owner is a bit non-technical and assures me that all is well on the SQL 
Server end.

I have the alias "Server" set up on freetds.conf, with the settings:
[Server]
host = 192.168.1.4
port = 1433
tds version = 7.0

and have set the environment vars at the beginning of my php script:
putenv("SYBASE=/usr/local/freetds");
putenv("TDSVER=7.0");

when I try to use mssql_connect ( 'Server', 'Paul', 'Bennett') the 
script fails silently - the connection function returns false, but there 
is no data in mssql_get_last_message ().

As an experiment, when I try to connect using mssql_connect ( 
'192.168.1.4', 'Server', 'Paul') I get:
Sybase message: Login failed for user 'SERVER\Guest'. (severity 14)

As another experiment, when I try to connect using mssql_connect ( 
'192.168.1.4,1433', 'Server', 'Paul') - adding port 1433 to the end of 
the ip string It fails silently again.

Any ideas how I can figure out how to connect?

-- 
 ------------------------------
	Paul Bennett						
	Internet Developer				
	Teltest Electronic Design		
 ------------------------------			
Email: paul at teltest.com				
Phone: 64 4 237 4557					
Web: http://www.teltest.com		
Wap: http://wap.teltest.com			




More information about the thelist mailing list