Applicable to:
- Plesk Onyx for Windows
Question
How to install pdo_dblib for PHP 7.2?
Answer
pdo_dblib
extension is deprecated starting from PHP 5.3 and is not available in PHP 5.3 or higher, refer to the following link for the details:
Microsoft SQL Server and Sybase Functions (PDO_DBLIB)
As an alternative, it is possible to install SqlSrv extension for PHP 7.2. For this:
Warning: The following steps are done at your own will and risk
-
Log into the server via RDP.
-
Download the latest driver version from Microsoft website
-
Run the downloaded EXE file
-
When prompted, enter the path to extract the PHP extensions.
-
Copy
php_sqlsrv_72_nts_x64.dll
andphp_pdo_sqlsrv_72_nts_x64.dll
files from the extracted archive to%plesk_dir%\Additional\PleskPHP72\ext\
Note: in case the PHP version is different, refer to
SQLSRV_Readme.htm
file from the extracted archive to find out the proper files. -
Add the following lines to
%plesk_dir%\Additional\PleskPHP72\php.ini
file:CONFIG_TEXT: extension=php_pdo_sqlsrv_72_nts_x64.dll
extension=php_sqlsrv_72_nts_x64.dll -
Restart IIS to apply the changes by executing the following command via the command line:
C:\> iisreset
-
Check that module is added properly:
C:\> "%plesk_dir%\additional\pleskphp72\php.exe" -m | findstr sqlsrv
pdo_sqlsrv
sqlsrv
Comments
2 comments
Hello smbraun,
Probably it's better to use sqlsrv and pdo_sqlsrv extensions according to https://support.plesk.com/hc/en-us/articles/115001401653
and use php code like https://www.microsoft.com/en-us/sql-server/developer-get-started/php/ubuntu/step/2.html
Unfortunately we do use a ubuntu 16.04 instead of windows server.
From the os-vendor-php we can connect by
But in the PHP-Version delivered by Plesk we get "driver not found".
Have somebody an idea how to get the driver from the os-php to the plesk-php?
Please sign in to leave a comment.