Unable to connect to the database. Using Postgre Driver |
I have followed the documentation regarding database configuration. https://codeigniter.com/user_guide/datab...tion.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.
[quote pid="417831" dateline="1712941958"]
PHP Code: // * Sample database connection for Postgre. [/quote]
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', |
Welcome Guest, Not a member yet? Register Sign In |