PHP Warning: PHP Startup: Unable to load Dynamic library 'pdo_sqlsrv.so' - php7.+++

Asked

Viewed 3,728 times

0

Upon completion of PHP7.++ 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.so' (tried: /usr/lib/php/20170718/pdo_sqlsrv.so (/usr/lib/php/20170718/pdo_sqlsrv.so: Ufinended Symbol: php_pdo_register_driver), /usr/lib/php/20170718/pdo_sqlsrv.so.so (/usr/lib/php/20170718/pdo_sqlsrv.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

1 answer

1

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

Extension=pdo_sqlsrv.so

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

This is also valid for Cli and FPM (php.ini files) After the settings it is necessary to load apache2. Just remembering that first you need to follow all the steps of installation and configuration of all packages and their dependencies, 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) everything has to be all right before... It worked for me perfectly.

Now works on Ubuntu 18.04 lts and Debian8. Thanks =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.