Skip to content

Register now for our Web Enablement Ecosystem webinar!

  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL

Knowledge Base

 How to install ‘sqlsrv’ extension for Plesk PHP handlers?

 
almalinuxcentoscloudlinuxdebianextensions

Question

It is required to connect to Microsoft SQL Server (MS SQL) databases via PHP script on a Plesk for Linux server.

What extension should be installed and how it can be done?

Answer

PHP extensions sqlsrv and pdo_sqlsrv should be installed and enabled for PHP handlers:

Warning: These extensions were not properly tested with Plesk and are not officially supported. Perform all operations at your own risk.

Warning: These extensions do not yet support operating systems AlmaLinux/RHEL 9, Debian 12, Ubuntu 24.04.

Note: These extensions are only for PHP 7.x and 8.x.
Instructions cover only operating systems supported both by Plesk and PHP extensions sqlsrv and pdo_sqlsrv:
-CentOS/RHEL/CloudLinux 7.x
-AlmaLinux/RHEL/CloudLinux/Rocky Linux 8.x
-Debian 10, 11
-Ubuntu 18.04, 20.04, 22.04

  1. Connect to the server using SSH.

  2. Install necessary packages:

    • on CentOS/AlmaLinux/RHEL/CloudLinux/Rocky Linux:

      # yum install unixODBC-devel make gcc-c++ gcc autoconf automake libtool-ltdl.x86_64 libtool-ltdl-devel.x86_64 plesk-phpXX-devel

      Note: "XX" in plesk-phpXX-devel should be replaced with the PHP version. For example, "74" for PHP 7.4, or "82" for PHP 8.2.

    • on Ubuntu and Debian:

      # apt install apt-transport-https make gcc g++ unixodbc unixodbc-dev plesk-phpXX-dev

      Note: "XX" in plesk-phpXX-dev should be replaced with the PHP version. For example, "74" for PHP 7.4, or "82" for PHP 8.2.

  3. Install Microsoft ODBC driver for SQL Server on which PHP extensions sqlsrv and pdo_sqlsrv rely on to handle the low-level communication with SQL Server:

    • on CentOS/AlmaLinux/RHEL/CloudLinux/Rocky Linux:

      # curl https://packages.microsoft.com/config/rhel/X/prod.repo > /etc/yum.repos.d/mssql-release.repo
      # yum remove unixODBC-utf16 unixODBC-utf16-devel
      # ACCEPT_EULA=Y yum install msodbcsql18

      Note: replace "X" in the curl command with "7" or "8" depending on the major version of used operating system.

    • on Ubuntu and Debian:

      Note: The below example is for Ubuntu 22.04. If another Ubuntu or Debian version is used, replace the highlighted URL part accordingly, with, for example, "ubuntu/20.04" for Ubuntu 20.04, or "debian/10" for Debian 10.

      # curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
      # curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
      # apt update
      # ACCEPT_EULA=Y apt install msodbcsql18

  4. Install PHP extensions sqlsrv and pdo_sqlsrv:

    • for PHP versions 7.3 and later in Plesk Obsidian 18.0.49 and later: in the Plesk interface by following instructions from the article How to install PECL packages in Plesk?

      Note: Extensions can be installed using only their names sqlsrv and pdo_sqlsrv only for PHP 8.1-8.3.
      For PHP versions 7.3-8.0, specific versions of the extensions must be specified in a dialog window which appears after clicking Install package:
      sqlsrv-5.9.0 for PHP 7.3
      sqlsrv-5.10.1 for PHP 7.4
      sqlsrv-5.11.1 for PHP 8.0
      sqlsrv-5.11.1 on Ubuntu 18.04 and with PHP 8.1-8.3.

      Note: Plesk PHP handler 7.3 is available only on CentOS/RHEL/CloudLinux 7.x, AlmaLinux/RHEL/CloudLinux/Rocky Linux 8.x, Ubuntu 18.04, 20.04, and Debian 10.

    • for PHP versions 7.0-7.2:

      # /opt/plesk/php/7.X/bin/pecl install pdo_sqlsrv-5.X.X
      # echo "extension=pdo_sqlsrv.so" > /opt/plesk/php/7.X/etc/php.d/pdo_sqlsrv.ini
      # /opt/plesk/php/7.X/bin/pecl install sqlsrv-5.X.X
      # echo "extension=sqlsrv.so" &gt…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

WP Toolkit 6.2 Release Now Available

Read More »

Recommended OSs for Plesk

Read More »

Getting Started With Plesk Extensions & Tools

Read More »
Knowledge Base

How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.x on Linux

Read More »

How to add Composer to a chrooted environment in Plesk?

Read More »

How to run Composer with Plesk PHP

Read More »

Mail accounts cannot log into Plesk web interface if password is encrypted

Read More »

Hosting Wiki

  • DBMS Interface
  • Server Redundancy
  • Linux Containers
  • PostgreSQL
  • Bare Metal Server
  • MySQL
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • MSSQL
  • SQL
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • SSH
  • URL
  • HTTP

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit