Mssql_connect Error Unable To Connect To Server
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Php Warning: Mssql_connect(): Unable To Connect To Server Linux
and policies of this site About Us Learn more about Stack Overflow mssql_connect example the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Mssql_connect() Unable To Connect To Server Ubuntu
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only mssql_connect undefined function takes a minute: Sign up mssql_connect(): Unable to connect to server up vote 0 down vote favorite I have a Centos server with apache and PHP on it, and I have a SQL Server on another server, when I try to connect to MSSQL with tsql -H "sql server ip" -p1433 -U sa, it works and connects OK, but when call to undefined function mssql_connect() wamp I try to run following PHP code error_reporting(E_ALL); ini_set('display_errors', '1'); $connection = mssql_connect('serverIP', 'username', 'password'); I get the error : Warning: mssql_coonect(): Unable to connect to server: serverIP in /var/www/html/mssql.php on line 4 what should I do? php sql-server share|improve this question edited Jul 21 '13 at 11:39 CodingIntrigue 29k869106 asked Jul 21 '13 at 11:37 Ehphan 1623316 1 echo mssql_get_last_message() to get the specific error –casraf Jul 21 '13 at 11:40 I did that and it shows blank!! –Ehphan Jul 21 '13 at 11:47 1 It seems there could be issues with your login info –Vector Jul 21 '13 at 11:49 no, my username and password works ok when I try to connect with tsql -H !!!! –Ehphan Jul 21 '13 at 11:51 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted You have to specify the servername and the instance like in this example,I think: http://ca3.php.net/manual/en/function.mssql-connect.php EDIT: The following method: server\instance does'nt work on unix systems... An instance is nothing more than specific port address di
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Mssql_select_db
policies of this site About Us Learn more about Stack Overflow the company mssql_connect unable to connect to server mac Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Mssql_connect Not Working In Php
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/17771922/mssql-connect-unable-to-connect-to-server minute: Sign up mssql_connect(): Unable to connect to server (without freetds.conf) up vote 2 down vote favorite 1 I have 2 servers: one is OpenSUSE, another one is SLES 11 sp2 Suse Linux Enterprise Server. In order to have connection to MSSQL I have to install mssql.so for php. OpenSUSE permits to install mssql from rpm. SLES - does not have http://stackoverflow.com/questions/13180746/mssql-connect-unable-to-connect-to-server-without-freetds-conf mssql rpm, and this is why need to compile it. OpenSUSE: mssql rpm installed => $server="172.x.x.x:49888"; $username="username"; $password="password"; $link = mssql_connect($server, $username, $password); here successfully connected to MSSQL! SLES: with mssql.so compiled => $server="172.x.x.x:49888"; $username="username"; $password="password"; $link = mssql_connect($server, $username, $password); error: Warning: mssql_connect(): Unable to connect to server: 172.x.x.x:49888 and if I edit freetds.conf #A typical Microsoft server [Dovico] host = 172.x.x.x port = 49888 tds version = 7.0 and change php like this: $server="Dovico"; $username="username"; $password="password"; $link = mssql_connect($server, $username, $password); => successfully connected to MSSQL! So my question is how can I have MSSQL connection on SLES (with mssql.so compiled) using this mssql_connect("172.x.x.x:49888", "username", "password"); and not using freetds.conf ? php sql-server freetds share|improve this question asked Nov 1 '12 at 15:53 ihtus 91251938 take the opensuse srpm for mssql and compile it on sles? –Marc B Nov 1 '12 at 15:57 add a comment| 1 Answer 1 active oldest votes up vote 11 down vote accepted ok, thanks to Jesus Christ, I got the solution: Edit freetds.conf (uncomment and change version): from [global] # TDS protocol vers
my machine) through PHP....but it's not connecting. I'm more of a mysql guy so i'm quite new to this I have tested https://www.sitepoint.com/community/t/trying-to-connect-to-ms-sql-from-php-no-luck-going-insane/5305 the settings with Microsoft SQL Server Management Studio Express and it connected fine. Here is what i'm doing in php: $host = 'ComputerName\\ServerName'; $user = 'steve'; $pass = 'awesome'; $connect = mssql_connect("$host", "$user", "$pass"); // and i get.... Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server:ComputerName\\ServerName in C:\\xampp\\htdocs\\sitename\\index.php on line 20 I really do not know what else unable to to do. Someone with more experience may be able to shed some light? edit. Oh yeah, mssql appears to be enabled (looking at my attachment) cmuench 2009-07-30 14:38:08 UTC #2 Have you enabled TCP connections on your sql server? strungoutyeh 2009-07-30 14:42:19 UTC #3 cmuench said: Have you enabled TCP connections on your sql server? no idea. how would unable to connect i do that? cheers for quick reply cmuench 2009-07-30 14:44:52 UTC #4 What version of sql server? strungoutyeh 2009-07-30 14:45:29 UTC #5 cmuench said: what Version Of Sql Server? 2005 cmuench 2009-07-30 14:48:28 UTC #6 http://support.microsoft.com/kb/914277 strungoutyeh 2009-07-30 15:03:20 UTC #7 cmuench said: http://support.microsoft.com/kb/914277 hmmmm damn, still didn't work after enabling TCP same error: Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: compname\servername in C:\xampp\htdocs\sitename\index.php on line 20 wwb_99 2009-07-30 15:04:20 UTC #8 Would help to know what error you are getting. Also, the mssql_* stuff is really bad, especially with modern versions of Sql Server. I used to generally use ODBC, but MS has also released a sql driver for PHP (or more properly PDO I think) which is really the way to go these days. strungoutyeh 2009-07-30 15:07:29 UTC #9 wwb_99 said: Would help to know what error you are getting. Also, the mssql_* stuff is really bad, especially with modern versions of Sql Server. I used to generally use ODBC, but MS has also released a sql driver for PHP (or