Azure AppService PHP 8.0: Cannot install php-pgsql extension

Greg Brandt 1 Reputation point

I have an AppService PHP 8.0 instance running. I enabled the php_pgsql extension and tried to install the extension using apt-get install php-pgsql but I get the following error.

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-pgsql is a virtual package provided by:
php7.3-pgsql 7.3.31-1~deb10u1 [Not candidate version]
php7.3-pgsql 7.3.29-1~deb10u1 [Not candidate version]

E: Package 'php-pgsql' has no installation candidate

Is there another way to install this package?

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
188 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 8,736 Reputation points

    Hello @Greg Brandt

    Please try the following to enable the php-pgsql extension for PHP on Azure Web Apps:

    Install extension

    echo "deb buster main" >> /etc/apt/sources.list  
    apt-get update && apt-get install -y libpq-dev  
    docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql  
    docker-php-ext-install pdo pdo_pgsql pgsql  

    Follow the guide of to configure in PHP runtime.

    Restart the site after configuring the settings.

    1 person found this answer helpful.