2

I am running a Linux server that already has freetds installed, but is not configured to support dblib. Only sqlite and mysql are currently supported for PDO. MSSQL support is also enabled.

If I want to add support for dblib and enable the PDO Driver for FreeTDS/Sybase DB-lib, do I just need to run this command on the existing install:

 ./configure --with-pdo-dblib

If so, from which directory would I run the command?

Environment: PHP Version 5.5.38 CENTOS 6.9

Thank you

MrB
  • 93
  • 2
  • 8

2 Answers2

0

If you have configured FreeTDS correctly, you should be able to connect like so:

$pdo = new PDO("dblib:host=mssql;dbname=$dbname", "$dbuser","$dbpwd");

If you can't, this answer gives more explicit instructions: Connect PHP to MSSQL via PDO ODBC

pdo_dblib is typically installed in most Linux distros when you install php-mssql (on CentOS and Ubuntu, for example). If the connect command isn't working, please rewrite your question to include the specific steps you have taken and the error output. Good luck!

FlipperPA
  • 13,607
  • 4
  • 39
  • 71
  • Thank you. Actually making a connection to the database is not an issue though, I can do that on our internal server that is configured with PDO ODBC. But on the server in question, it was not installed for some reason. My issue is adding / activating that driver. But since asking this question, support at the hosting company has added the driver. – MrB Aug 28 '17 at 18:28
0

Since writing this question, the support team at the company that is hosting this server installed the driver. I don't know exactly what steps they took to do it so I can not post a step by step answer as I would like. Closing this question.

MrB
  • 93
  • 2
  • 8