首页  >  问答  >  正文

PHP 8.1升级后,无法找到sqlsrv pdo驱动程序

升级到 php 8.1 (Linux PHP) 后,Azure webapp 似乎没有 MS SQL 的驱动程序。 php 7.4 没问题。

按照本指南 (https://learn.microsoft.com/en-us/azure/app-service/deploy-local-git?tabs=cli),构建和配置 Azure 应用服务的步骤是: az appservice plan create -g rg-MyResourceG -n MyPlan --is-linux az webapp create -g rg-MyResource --plan MyPlan --name MyApp --% --runtime "PHP|7.4" --deployment-local-git 按照本指南更改为 PHP 8.1:https://github.com/Azure/app-service-linux-docs/blob/master/Runtime_Support/php_support.md az webapp config appsettings set --name MyApp --resource-group MyResourceG --settings DEPLOYMENT_BRANCH='main' 在我的本地服务器上: php artisan key:generate --show az webapp config appsettings set --name Glados9L --resource-group rg-blueprism-tst --settings APP_KEY="最后一个命令的输出" APP_DEBUG="true" git 远程添加glados9l https://MyUser@MyApp.scm.azurewebsites.net/MyApp.git git推送glados9l主要 ………… 远程:223 秒内完成。 偏僻的: 偏僻的: Removing existing manifest file 偏僻的: Creating a manifest file... 偏僻的: Manifest file created. 偏僻的: Copying .ostype to manifest output directory. 偏僻的: 偏僻的: Done in 457 sec(s). 偏僻的: Running post deployment command(s)... 偏僻的: 偏僻的: Generating summary of Oryx build 偏僻的: Parsing the build logs 偏僻的: Found 0 issue(s) 偏僻的: 偏僻的: Build Summary : 偏僻的: =============== 偏僻的: Errors (0) 偏僻的: Warnings (0) 偏僻的: 偏僻的: Triggering recycle (preview mode disabled). 偏僻的: Deployment successful. deployer = deploymentPath = 偏僻的: Deployment Logs : 'https://glados9l.scm.azurewebsites.net/newui/jsonviewer?view_url=/api/deployments/ef2b3e8ce9341d66fa5e64826721e09085dbe214/log' 至 https://myplan.scm.azurewebsites.net/Glados9L.git

root@9dcf7762daa9:/home# php -i | grep sqlsrv
Cannot load Zend OPcache - it was already loaded
root@9dcf7762daa9:/home# odbcinst -j
unixODBC 2.3.7
DRIVERS………….: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
root@9dcf7762daa9:/home# php -v
Cannot load Zend OPcache - it was already loaded
PHP 8.1.6 (cli) (built: Aug 17 2022 07:43:32) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies
root@9dcf7762daa9:/home#


P粉649990163P粉649990163279 天前648

全部回复(1)我来回复

  • P粉738821035

    P粉7388210352023-12-20 10:14:04

    根据此拉取请求,PHP 8.1 映像中缺少 pdo_sqlsrv 是一个已知问题,他们很快就会添加这个驱动程序。

    目前,您可以按照 这篇文章

    回复
    0
  • 取消回复