T
T
terehinis2014-11-28 15:29:26
Yii
terehinis, 2014-11-28 15:29:26

PHP + YII + DBLIB + MSSQL + CentOS = SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9) How to fix?

The actual error is CDbConnection failed to open the DB connection: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9) when connecting to the database.

'db'=>array(
'connectionString' =>"dblib:dbname=JobBase;host=egServer70",
'charset' => 'utf8',
'username' => 'test',
'password' => 'test' ,
'enableProfiling' => true,
'enableParamLogging' => true,
),

freetds.conf

[egServer70]
host=server.ru
port=1433
tds version=8.0
client charset=UTF-8

Everything seems to be fine, on 2 servers that I raised half a year ago everything is fine. All that has changed is PHP 5.5 on the old and PHP 5.6 on the new (doesn't work). And another OS version, was CentOS 6.5 became CentOS 6.6.
And through tsql it is perfectly connected.
iptables is off

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
terehinis, 2014-11-29
@terehinis

It turned out the whole thing was SELinux, turned it off and everything became normal

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question