Adding mssql support in php5 on Debian or Ubuntu

To add/install MSSQL support in PHP5 on Debian linux server, follow the below steps:

  1. Install FreeTDS and the PHP MS SQL extension

sudo apt-get install freetds-common freetds-bin unixodbc php5-sybase
Note: That is correct, the MS SQL extension is in the “php5-sybase” package.

  1. Restart Apache

sudo /etc/init.d/apache2 restart

If everything went fine then you will be able to connect to your MSSQL Server using mssql_connect().

Scroll to top