![]() |
Unable to connect to the database. Using Postgre Driver - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9) +--- Thread: Unable to connect to the database. Using Postgre Driver (/showthread.php?tid=90639) |
Unable to connect to the database. Using Postgre Driver - warcooft - 04-12-2024 I have followed the documentation regarding database configuration. https://codeigniter.com/user_guide/database/configuration.html# here my db config: PHP Code: public array $default = [ and then i got this error: Unable to connect to the database. Main connection [Postgre]: pg_connect(): Unable to connect to PostgreSQL server: invalid sslmode value: "1" Here details: https://postimg.cc/bGf6Kmfw I have applied the above configuration to the .env file in Codeigniter 4.4.8 and it works fine, but why doesn't it work in Codeigniter 4.5.0? Previously I tried to apply it in .env exactly with version 4.4.8 but it didn't work. Lastly, I configured it in the Config\Database.php file and it also didn't work. RE: Unable to connect to the database. Using Postgre Driver - warcooft - 04-12-2024 [quote pid="417831" dateline="1712941958"] PHP Code: // * Sample database connection for Postgre. [/quote] RE: Unable to connect to the database. Using Postgre Driver - raicou - 04-13-2024 The error should be quite self-explanatory, "1" is not a valid value for sslmode. Try: Code: 'DSN' => 'Postgre://username:password@hostname:5432/database?charset=utf8&connect_timeout=5&sslmode=allow', |