php 8.1 sqlsrv extensions missing

Chris Loelke 21 Reputation points
2022-10-17T16:57:40.467+00:00

When using the linux web app with PHP 8.1.
The pdo_sqlsrv and the sqlsrv extensions are no longer there, is there a way to get?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

Answer accepted by question author
  1. VenkateshDodda-MSFT 25,241 Reputation points Microsoft Employee Moderator
    2022-10-18T11:30:53.057+00:00

    @Chris Loelke Thank you for reaching out to Microsoft Q&A, apologize for the inconvenience caused on this.

    To reproduce this behavior i have deployed web app with php8.1 running on linux operating system. You can run the below cmdlet in the SSH console to check the list of extensions installed by default.

    php -m | grep pdo   
    

    Post running the above cmdlet we have observed that pdo_sqlsrv extension is missing.

    Follow below steps to manually install the pdo_sqlsrv extension in your web app

    • Add a bin directory to the root directory of your app and put the .so extension files in it
    • Download the Debian11-8.1.tar file from here extract the .tar file and copy the .so file to the bin folder.
    • Create a directory in /home/site called ini, then create an .ini file in the /home/site/ini directory (for example, settings.ini) with the directives you want to customize. and add the below line of code into that .ini file. extension=<path_of_the_.sofile>/php_pdo_sqlsrv_81_nts.so
    • Add the application settings PHP_INI_SCAN_DIR under configuration tab from the portal PHP_INI_SCAN_DIR="/usr/local/etc/php/conf.d:/home/site/ini"
    • Once the above steps were completed, Stop and start the web app.

    You can follow these documentation steps to enable php extension in your linux webapps.

    Feel free to reach back to me if you have any further queries on this.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.