In order to connect to MSSQL, you need to activate the PDO / DBLib extension under PHP extensions.
To activate PHP extensions, select “Webserver” -> “Main domain settings” and from there select “modify” -> “PHP extensions”.
Via the extensions menu, enable PDO / DBLib
.
In order to change the settings for connecting to the MS SQL server, you need to create a new file in the home directory /data0X/virtXXX/ named .freetds.conf,
(NB! the file name starts with a dot) with the following contents for example:
[ODBC] host = 123.123.123.123 port = 1234 tds version = 8.0 client charset = UTF-8 mssql.charset = "UTF-8" |
Sample script for creating an MSSQL connection:
$pdo = new PDO('dblib:host=ODBC;dbname=database_name;', 'user', 'pass'); |
Details on how to configure .freetds.conf can be found on the FreeTDS website.