IPv6 database connection to Postgres
I already asked in the Matrix chat but I'll try here, too. I tried to migrate my database to an IPv6 only host (It's a FreeBSD jail, to be precise). When I set$db_host in .htconfig.php to an ipv6 address, my instance becomes unavailable. I tried the formats [2001:db8::666] and 2001:db8::666. Both don't work.From the regular cron job I get the following error in the php log:
[17-Jul-2026 20:30:01 Europe/Zurich] PHP Fatal error: Uncaught TypeError: dba_driver::__construct(): Argument #1 ($server) must be of type string, null given, called in /usr/local/www/grindc
ore.ch/include/dba/dba_driver.php on line 68 and defined in /usr/local/www/grindcore.ch/include/dba/dba_driver.php:144
Stack trace:
#0 /usr/local/www/grindcore.ch/include/dba/dba_driver.php(68): dba_driver->__construct(NULL, 'pgsql', 5432, 'hubzilla', '**********...', 'hubzilla', 'UTF8', false)
#1 /usr/local/www/grindcore.ch/boot.php(698): DBA::dba_factory(NULL, 5432, 'hubzilla', 'V9WHpLSLNdcMqXD...', 'hubzilla', '1', 'UTF8', false)
#2 /usr/local/www/grindcore.ch/include/cli_startup.php(11): sys_boot()
#3 /usr/local/www/grindcore.ch/Zotlabs/Daemon/Master.php(46): cli_startup()
#4 /usr/local/www/grindcore.ch/Zotlabs/Daemon/Master.php(13): Zotlabs\Daemon\Master::Release(1, Array)
#5 {main}
thrown in /usr/local/www/grindcore.ch/include/dba/dba_driver.php on line 144What's interesting is that in
boot.php the value NULL seems to be passed as database host to the dba_driver constructor. If I understand this correctly it means that somewhere in boot.php the value of $db_host from .htconfig.php seems to be set to NULL but I couldn't find any code that modifies the content of this variable before passing it on.Am I misreading the error message here? Could anyone more familiar with the code give me a pointer what I'm missing and where to look?
Thanks
--beni
The usual disclaimer holds: I gave my best to describe what my intentions were but chances are that I have no idea what I'm doing and that my code is useless. The last time I wrote php code is more than 20 years ago.
I think it looks good in general. A few nitpicks, but nothing major. I leave the final judgement to Mario :)
Regarding the 20 years: My memory isn't that good to remember single functions. All I remember is to use dollar signs for variables and curly braces for blocks. Apart from this I sadly have to read documentation and search the web. I did check though whether we require PHP 8 before using those new constructs.