witam.
Mam oto taka klasę odpowiadającą za łączenie się z bazą:

  1. <?php
  2.  
  3. class Database
  4. {
  5.    private $server = 'KONRADSQLEXPRESS';
  6.    private $db = "health";
  7.    private $login = "health";
  8.    private $pass = "health";
  9.    
  10.    private $link = null;
  11.    private static $instance;
  12.    
  13.    public function __construct()
  14.    {
  15.        try {
  16.            $this->link = new PDO ('mssql:host='.$this->server.';dbname='.$this->db, $this->login, $this->pass);
  17.        } catch (PDOException $e) {
  18.            die($e->getMessage() . "<br />" . $e->getTraceAsString());
  19.        }
  20.    }
  21.    
  22.    public static function getInstance()
  23.    {
  24.        if ( self::$instance ) return self::$instance;
  25.        return self::$instance = new Database();
  26.    }
  27.    
  28.    public function query($query, $values)
  29.    {
  30.        $stmt = $this->link->prepare($query);
  31.        $stmt->execute($values);
  32.  
  33.        return $stmt->fetchAll();
  34.    }
  35. }
  36.  
  37. ?>


I przy próbie połączenia dostaje komunikat:
Kod
SQLSTATE[01002] Unable to connect: SQL Server is unavailable or does not exist.  Specified SQL server not found. (severity 9)
#0 C:\Works\Apache\htdocs\HealtProject\inc\Database.php(16): PDO->__construct('mssql:host=loca...', 'health', 'health')
#1 C:\Works\Apache\htdocs\HealtProject\inc\Database.php(25): Database->__construct()
#2 C:\Works\Apache\htdocs\HealtProject\services\AdminService.php(14): Database::getInstance()
#3 C:\Works\Apache\htdocs\HealtProject\index.php(7): AdminService->login('travikk', 't4r4w411')
#4 {main}


Czy wie ktoś co na to zaradzić? Zszukałem się rozwiązań po sieci, i tak - mam włączone remote connections dla TCP/IP i Named Pipes. Prosze o pomoc, bardzo zależy mi na szybkim i sprawnym rozwiżaniu tego problemu.