PHP Warning: PHP Startup :Unable to load dynamic library 'pdo sqlsrv.so' - php7.+++

Upon completion of PHP7 installation.++ I got the following error after performing all steps of SQL Server PDO driver configuration Tutorial for php, restart apache2:

PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv driver.so' (tried: /usr/lib/php/20170718/pdo_sqlsrv driver.so (/usr/lib/php/20170718/pdo_sqlsrv driver.so: undefined symbol: php_pdo_register_driver), /usr/lib/php/20170718/pdo_sqlsrv driver.so.so (/usr/lib/php/20170718/pdo_sqlsrv driver.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Reference: https://docs.microsoft.com/pt-br/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-2017#installing-the-drivers-on-ubuntu-1604-1710-and-1804

Author: Washington Monteiro, 2018-08-05

1 answers

After some checks and load's of PHP7'S PDOs (Apache) I identified that 10-pdo.ini needs to be loaded before PDO library pdo_sqlsrv.so so I removed from php.ini the following line:

Extension=pdo_sqlsrv.so

I added the following file to the load in the conf folder.d: /etc / php / 7.2 / apache2 / conf.d / 30-pdo_sqlsrv.ini with extention: extension=pdo_sqlsrv.so

This is also valid for CLI and FPM (php files.ini) After Settings reload is required in apache2. Just reminding you that you need to follow all the steps in the installation and configuration of all packages and their dependencies by following the tutorial provided by Microsoft for php7+, and SQL Server (https://docs.microsoft.com/pt-br/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-2017#installing-the-drivers-on-debian-8-and-9), you need to be all right before you... It worked for me perfectly.

Now works in ubuntu 18.04 LTS and Debian8. thanks=)

 1
Author: Washington Monteiro, 2018-08-05 22:44:05