Call to undefined function pg_connect()

apps
software development

#1

I’m trying to query a remote PostGreSQL database via a shortcode in WordPress and am getting the following error message:

Call to undefined function pg_connect()

I’m able to successfully connect to (and query) the remote database on my local machine, wondering if there’s a setting that can be changed so that this will work on DreamHost.

Thanks,

Doug


#2

I haven’t used PostgreSQL from DreamHost but that error makes me think that PHP is not loading the Postgres driver. You probably have to modify your phprc/php.ini to load it.

You can also do one test from command line using psql and make sure that the machine where WordPress runs can reach your remote server correctly. Let us know how this goes.


#3

Thanks! Took me a while to figure it out, but looks like all that I needed to do was add the following line to phprc:

extension = pgsql.so

#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.