cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator

arun123

Registered
Oct 10, 2011
2
0
51
cPanel Access Level
Root Administrator
Hi Guyz

I used the method mentioned in this post enable the mssql support. It gives all the necessary steps in enabling mssql support for php.
/http://linuxwebservertips.in/mssql_support_php/
 

chrismfz

Well-Known Member
Jul 4, 2007
127
1
68
Greece
cPanel Access Level
DataCenter Provider
unixODBC and FreeTDS installed properly.
Mssql also seems enabled in phpinfo().

Using tsql I can connect to a MSSQL server through the console.
But using php I can't.

An example:
php:
Code:
if (function_exists('mssql_connect')){
        echo 'OK<br />';
} else {
        echo 'NOT OK';

}
$connect = mssql_connect("xxx.xxx.xxx.xxx,1443", "user", "pass");
var_dump($connect);
$selected = mssql_select_db("db", $connect)
 or die("Couldn't open database");
And I get:
Code:
OK
bool(false) Couldn't open database
So, mssql commands seems to exist, I can connect normally through console using tsql, but not using php.
Any ideas?
 

mtindor

Well-Known Member
Sep 14, 2004
1,417
82
178
inside a catfish
cPanel Access Level
Root Administrator
If you're using a firewall such as CSF, you'll want to make sure that you add 1433 to the TCP_OUT exception list. Otherwise your server will not be able to connect outbound to the port.

Although, if you've connected to the same MSSQL server via the commandline of the cPanel server, firewall blocking likely is not the issue.

Mike