Mssql using php-zendserver docker container

General discussion forum for the Zend Server

Mssql using php-zendserver docker container

Postby jimm2354 on Tue Feb 28, 2017 12:52 pm

Hello,

I cannot connect to a MSSQL database trough docker php-zendserver container running a zendserver application.

We are using php-zendserver:8.5-php5.6
Did activate pdo_dblib, mssql and odbc extensions inside zendserver.

It did work before until we moved everything to docker. And we have not changed any credentials, (it is still working on production and test with the same credentials).
Our application are running on the zendserver container enviroment and we can access it trough the browser.
We are trying to make a connection to MSSQL using Zend_Db

So my guess is that the Mssql library are not setuped correctly on the docker container, and I would really appreciate some help on this issue.

Code: Select all
$db = \Zend_Db::factory('Pdo_Mssql', array(
                "username" => $config['username'],
                "password" => $config['password'],
                "dbname" => $config['dbname'],
                "host" => $config['host'],
                "port" => $config['port'],
                "pdoType" => 'dblib'
            ));


Best Regards
/ Jim
jimm2354
 
Posts: 8
Joined: Tue May 10, 2016 3:57 pm

Re: Mssql using php-zendserver docker container

Postby jimm2354 on Tue Feb 28, 2017 1:00 pm

I recieve these exceptions:

Code: Select all
  [Zend_Db_Adapter_Exception]                                     
  SQLSTATE[01002] Adaptive Server connection failed (severity 9) 

  [PDOException]                                                 
  SQLSTATE[01002] Adaptive Server connection failed (severity 9)
jimm2354
 
Posts: 8
Joined: Tue May 10, 2016 3:57 pm

Re: Mssql using php-zendserver docker container

Postby zvika on Thu Mar 02, 2017 2:04 pm

Hello Jim,
I would first check phpinfo() to see the extensions are enabled,
and then connect and query directly, without the Zend Framework layer (for testing and because ZF1 is no longer maintained or supported without special SLA).

If you have an SLA on Zend Server, feel free to open a support ticket after testing direct connection, with your findings and support tool snapshot from the docker instance.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 983
Joined: Sun Dec 14, 2008 9:48 am

Re: Mssql using php-zendserver docker container

Postby jimm2354 on Tue Mar 14, 2017 12:38 pm

Hello,

I solved the issue by following an article.. MSSQL Connection Failure from Linux (FreeTDS / DBLib)
jimm2354
 
Posts: 8
Joined: Tue May 10, 2016 3:57 pm


Return to Zend Server

Who is online

Users browsing this forum: No registered users and 3 guests