2

Does anyone know why mssql_connect would be slow? PHP is running on a Linux server with FreeTDS. I am trying to connect to a remote database. When I connect from PHP it takes about 3 seconds, but if I use the FreeTDS tsql command from the shell it connects in under a second, so it is able to connect faster. Is there a setting I can change or a different driver I should use?

Meir
  • 171
  • 1
  • 7

1 Answers1

0

You should start using PDO with MSSQL driver support.

More info on:

http://php.net/manual/en/ref.pdo-dblib.php

And some examples:

Connecting to mssql using pdo through php and linux

Community
  • 1
  • 1
  • PDO is just as slow. I think it uses the same driver as mssql_connect. Also for some reason it also crashes after connecting and I get an empty response. – Meir Oct 12 '12 at 17:17