How do I enable php to work with postgresql?
Try this:
Uncomment the following in php.ini by removing the ";"
;extension=php_pgsql.dll
Use the following code to connect to a postgresql database server:
pg_connect("host=localhost dbname=dbname user=username password=password")
or die("Can't connect to database".pg_last_error());
how to enable php pdo driver for Postgres on Ubuntu 18.04
I think you're missing the php-pgsql
library, run the following commands and it should start working (keep the changes for the php.ini files):
sudo apt install php-pgsql
sudo service apache2 reload
I do not have Ubuntu which means the library names could be different.
Hope it helps
Configure PHP and PostgreSQL on Windows
This tutorial worked for me:
The PHP extension will look for
libpq.dll
which is found of your
PostgreSQL installation. The simple fix is to add the path than
contains that file to your environment PATH.
Related Topics
How to Print SQL Statement in Codeigniter Model
Mysqli_Real_Connect(): (Hy000/2002): No Such File or Directory
Dynamic Paypal Button Generation - Isn't It Very Insecure
Mysql_Escape_String VS MySQL_Real_Escape_String
Using Wget to Run a Cronjob PHP
How to Redirect Back to Form with Input - Laravel 5
Sending Multiple Data Parameters with Jquery Ajax
Mock in PHPunit - Multiple Configuration of the Same Method with Different Arguments
Why Are PHP Function Calls *So* Expensive
Codeigniter Multiple File Upload Messes File Extension
Adding Three Months to a Date in PHP
Stop Script Execution Upon Notice/Warning
Can Servers Block Curl Requests
Fatal Error: Out of Memory, But I Do Have Plenty of Memory (Php)