Hi Flarum Community,
I'm struggling with a fresh Flarum (latest version, installed via composer create-project flarum/flarum .) on a DigitalOcean droplet running Ubuntu 24.04 LTS ("Noble") with PHP 8.3. The site is accessed via a Cloudflare Tunnel.
The Flarum front page loads, but I'm facing critical issues:
Login and Registration: All attempts (login with initial admin, new user registration) result in a "400 Bad Request" error in the browser.
API Calls: The browser console shows 404 errors for essential requests like /api/discussions.
Flarum Logs are Empty: The storage/logs/flarum-*.log file is always empty, even after setting 'debug' => true in config.php. This makes debugging very difficult.
Server Requirements & Setup (as per Flarum docs):
Nginx: Configured with root /var/www/flarum/public; and standard Flarum try_files rules. PHP-FPM (php8.3-fpm.sock) is used. Headers like fastcgi_param HTTPS on; and fastcgi_param REMOTE_ADDR $http_cf_connecting_ip; are passed.
PHP 8.3 Extensions (Verified Installed): curl, xml (for dom), fileinfo, gd, json, mbstring, openssl, pdo_mysql (using php8.3-mysql), tokenizer, zip.
MySQL 8.0+
Flarum config.php:
'url' is correctly set to https://forum.cyoa.cafe.
'trustedProxies' includes '127.0.0.1'.
Permissions: storage/ and public/assets/ (and their contents) are www-data:www-data with u=rwX,g=rwX permissions.
Logs: Nginx site error log is empty. Nginx access log shows the 400s/404s. PHP-FPM log (/var/log/php8.3-fpm.log) shows no runtime errors.
A Potential Rabbit Hole: The php8.3-sodium Saga
While the official Flarum requirements don't list sodium as a mandatory PHP extension, we explored this path because 400 errors can sometimes relate to crypto/session issues. We discovered:
The php8.3-sodium package is currently not installable via apt on Ubuntu 24.04 LTS. packages.ubuntu.com shows an empty download section for it on noble.
pecl install libsodium fails as it's incompatible with PHP 8.3.
Question: Could the absence of php8.3-sodium (even if not strictly "required" by docs) lead to these specific errors and, crucially, the empty Flarum logs? Or is this a red herring?
What I've Tried to Get Logs/Fix It (No Luck):
php flarum cache:clear, php flarum migrate (run as www-data).
Ensuring storage/logs directory exists and is writable by www-data.
My Main Questions:
Why would Flarum logs be completely empty with debug: true even when encountering 400/404 errors on core functions? This is the biggest blocker for further diagnosis.
Given the installed extensions match the documented requirements, what are common causes for 400 (Bad Request) on login/register and 404s on /api/* for a fresh install?
Is there any known issue or specific PHP 8.3 / Ubuntu 24.04 configuration quirk that might lead to this?
While php-sodium isn't listed as required, could its absence (or issues with PHP 8.3's core sodium functions if it relies on those) cause these problems?
I'm really hoping to get this resolved and would appreciate any guidance or troubleshooting steps the community can offer. The lack of Flarum logs is particularly puzzling.
Thanks in advance!
PS Yes, the text is written by Gemini, he also helped me with the installation... But after two days of trying, I don't know what to do next.