After updating I get Fatal error: Uncaught Error: Call to undefined function pg_connect() on localhost PHP script

Just updated to Big Sur. I have localhost running some PHP script to a Postgres db. Everything worked fine before, but now I get Fatal error: Uncaught Error: Call to undefined function pgconnect(). Have uncommented LoadModule php7module libexec/apache2/libphp7.so and restarted, but it doesn't work. Have searched and searched, but nothing seems to work. Any suggestions?
same issue happened for me and got the solution and working now
First of all the apache default path as been changed to "/usr/local/etc/httpd/httpd.conf" so make the config changes in that file. Also in that file instead of "LoadModule php7module libexec/apache2/libphp7.so" it will be like "LoadModule php7_module lib/httpd/modules/libphp7.so" and below that add 3 more lines
"<FilesMatch .php$>
    SetHandler application/x-httpd-php
</FilesMatch>"
and make sure libphp7.so module is present in "/usr/local/Cellar/httpd/2.4.46/lib/httpd/modules/libphp7.so" and then restart your apache and copy all the application files into default web directory which is "/usr/local/var/www". This took me almost 3 full day to find the solution 😔. Let me know if you have any doubt 😊. Hope it was useful for you cheers.
After updating I get Fatal error: Uncaught Error: Call to undefined function pg_connect() on localhost PHP script
 
 
Q