Hi there!
I am new to elgg and I was wondering if postgresql works with elgg. I've tried changing the port in the settings.php to 5432 since that's the port where my local psql responds to. Here's part of the settings in my settings.php:
$CONFIG->dbuser = 'dbuser'; $CONFIG->dbpass = 'dbpassword'; $CONFIG->dbname = 'dbname'; $CONFIG->dbhost = 'localhost'; $CONFIG->dbport = '5432'; $CONFIG->dbprefix = 'project_'; $CONFIG->dbencoding = 'utf8mb4';
I've tried changing the port to 3306 for mysql and it works. It doesn't seem to work for postgresql.
Probably there are stuff I need to add or modify. What is the usual setup for the settings.php for postgresql?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly

iionly - 1 like
- Jerome Bakker@jeabakker

Jerome Bakker - 1 like
- renstan@renstan

renstan - 0 likes
- renstan@renstan

renstan - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
You must log in to post replies.Elgg officially supports MySQL and nothing else. By own experience I can say that MariaDB also works. But I don't think Postgres will work - at least not out of the box.
There are some discussion threads - many years old (pre-Elgg 2) - that clearly say it will definitely not work. With Elgg 2 a database abstraction layer was introduced that probably would make it possible to use Postgres. But please don't ask me how. And it will definitely not be as simple as making some trivial changes in settings.php! My suggestion: use MySQL or MariaDB and it works.
As iionly mentioned only MySQL is officially supported. WIth the database abstraction layer it should be possible to also use PostgreSQL but try at your own risk.
Try changing https://github.com/Elgg/Elgg/blob/3.3/engine/classes/Elgg/Application.php#L657 and https://github.com/Elgg/Elgg/blob/3.3/engine/classes/Elgg/Database.php#L151
I don't know the correct values for PostgreSQL, please be careful ;)
Thank you for all of your advise. I will try changing what you mentioned, Jerome. If it doesn't go well, I'll stick to MySQL. Thanks again iionly and Jerome!
Just an update. The modifying of the files doesn't work. Here's the lines I've changed:
Line 657 of Application.php(as stated above)
Line 151 of Database.php(as stated above)
also tried
It results to: Fatal error in exception handler. Check log for Exception at time 1594642615
Since the files are part of the elgg directory in vendor, not a good idea to modify. Will be overwritten when it gets updated.
Conclusion: Will stick to MySQL.
Thank you, this is such a good learning experience *thumbs up*
Just curious to know - what's in your server error log?