Connection problem with MS-SQL-server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Georg Gerber

    #1

    Connection problem with MS-SQL-server

    Hello,

    I use an Apache-Web-Server 1.3 with PHP 5 under Windows 2000. With a
    PHP-script I want to get data from a MS-SQL-Server.
    Therefore is within my php.ini:

    extension=php_m ssql.dll

    Within my PHP-script the first relevant line is:

    $conn=mssql_con nect("mySqlServ erName", "myUserID", "myPassword ");
    if (! $conn) Die("Error opening database: ".mssql_get_las t_message());


    I want to work with 2 SQL-servers.

    With the first one (version unknown) the connection succeed and I can get
    data.

    With the other (MS-SQL-Server 2000) I get an error trying to connect to the
    SQL-Server:

    Warning: mssql_connect() : Unable to connect to server: mySqlServerName



    The same script runs on another web-Server without any problem and can get
    data from both SQL-Servers. I can also get data from both SQL-Server from
    my machine using other tools (i.e. a Java-applikation). So the error must
    be caused by PHP, ini-files, DLLs, ... on my machine.

    With some tools I have recognized, that in case of a successful
    MS-SQL-connection, the client (in my case the PHP-interpreter) opens a
    socket connection on port 1433 to the SQL-server. In my case such a socket
    connection is not opened.

    Somebody has an idea, what I can do ?

    Georg Gerber

  • Jochen Daum

    #2
    Re: Connection problem with MS-SQL-server

    Hi Joshua!
    On Thu, 31 Jul 2003 17:45:31 -0400, Joshua Ghiloni
    <jdg11@SPAM.ME. AND.DIE.cwru.ed u> wrote:
    [color=blue]
    >[color=green]
    >> With the other (MS-SQL-Server 2000) I get an error trying to connect to the
    >> SQL-Server:
    >>
    >> Warning: mssql_connect() : Unable to connect to server: mySqlServerName
    >>
    >>
    >>[/color]
    >
    >I might be off-base here, since the last time I tried this was in 2001,
    >but I remember that PHP's MS SQL support only went up to the version
    >just prior to MS SQL Server 2000 (6.5 or 7 maybe?). I'd be willing to
    >wager that that is your problem.[/color]

    I think this is a limitation of the FreeTDS connection, if you're
    connecting from Linux and also solved now.

    HTH, Jochen

    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    http://sourceforge.net/projects/phpdbedittk/

    Comment

    • Georg Gerber

      #3
      Re: Connection problem with MS-SQL-server

      > PHP's MS SQL support only went up to the version[color=blue]
      > just prior to MS SQL Server 2000 (6.5 or 7 maybe?).[/color]

      thank you.

      Running my script on another server succeed to connect to the SQL Server
      2000. The difference is: on my server is an Apache on the other an IIS;
      but PHP 5 is the same. So I think, this cannot be the problem.

      Comment

      Working...