problem comunication between php (apache) moduel and mssql server

Hello everyone

Recently I tried to connect to an mssql server throgh php script, unfortunatelly I wasen’t successfull. I think I have incounter some sort of compatibility problem of openssl library and php couse’ the error I am gettin in log file is the following:

[Thu Feb 21 11:49:18.687975 2019] [php7:error] [pid 4204] [client ::1:58328] PHP Fatal error:  Uncaught PDOException: SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers] in /home/rosty/Documenti/developing/lavoro/calligaris/codificationTransalation/transform/vendor/catfan/medoo/src/Medoo.php:321
Stack trace:
#0 /directory/index.php(8): Medoo\\Medoo->__construct(Array)
#1 {main}
  thrown in /directory/vendor/catfan/medoo/src/Medoo.php on line 321, referer: http://localhost/

I hadn’t mssql driver on my machine by default (like most linuxuser I guess) so I tried to install it following the this steps

first of all I have installed apache2 apache-mod_php7 php7 php7-pear php7-devel packeges

then I installed odbc driver following this tuttorial

after that I have installed sqlsrv and pdo_sqlsrv using pecl

I have created sqlsrv.ini and pdo_sqlsrv.ini in conf.d folder, under my php module folder (php7/conf.d/*).

I also added the folowing lines in my php.ini file under apache2 folder

After all that I have restarted apache2 using apachectl restart

my connection php script contain the folowing lines

  • $database =newMedoo(
  • 'database_type'=>'mssql',
  • 'database_name'=>'name',
  • 'server'=>'localhost',
  • 'username'=>'your_username',
  • 'password'=>'your_password'
  • )

this is the output of

php7 -i | grep -i sqlsrv


Registered PHP Streams => php, file, glob, data, http, ftp, https, ftps, **sqlsrv**, compress.zlib
PDO drivers => sqlite, **sqlsrv**
pdo_**sqlsrv** support => enabled
pdo_**sqlsrv**.client_buffer_max_kb_size => 10240 => 10240
pdo_**sqlsrv**.log_severity => 0 => 0
**sqlsrv** support => enabled
**sqlsrv**.ClientBufferMaxKBSize => 10240 => 10240
**sqlsrv**.LogSeverity => 0 => 0
**sqlsrv**.LogSubsystems => 0 => 0
**sqlsrv**.WarningsReturnAsErrors => On => On

So do enybody had this problem before?

I would apriciate any sort of help.
I probably do not understand compleatly how do database drivers interact with php/apache so this make me tacke so long to fix this issue.