So I'm doing a test run upgrading my Flarum installation to beta 8.1. I followed the instructions carefully, installing from scratch, copying over my existing config.php
and assets
, and then running composer update
, php flarum migrate
, and php flarum cache:clear
. Everything seemed to go fine, until I actually tried visiting my forum in the browser (yes, I have my forum's subdomain pointing at the public
directory), which gave me a 500 error. Checking my apache log reveals the actual error:
[Thu Dec 27 16:11:40.109942 2018] [php7:error] [pid 3793] [client 173.67.19.158:60479] PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/var/www/testforum.mysite.net/public/../storage/logs/flarum-2018-12-28.log" could not be opened: failed to open stream: Permission denied in /var/www/testforum.mysite.net/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107\nStack trace:\n#0 /var/www/testforum.mysite.net/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(119): Monolog\\Handler\\StreamHandler->write(Array)\n#1 /var/www/testforum.mysite.net/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(39): Monolog\\Handler\\RotatingFileHandler->write(Array)\n#2 /var/www/testforum.mysite.net/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\\Handler\\AbstractProcessingHandler->handle(Array)\n#3 /var/www/testforum.mysite.net/vendor/monolog/monolog/src/Monolog/Logger.php(707): Monolog\\Logger->addRecord(400, Object(Error), Array)\n#4 /var/www/testforum.mysite.net/vendor/flarum/core/src/Http/Middleware/HandleErrorsWithView.php(87): Monolo in /var/www/testforum.mysite.net/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
So it looks like it doesn't have permission writing a log file? Here are the permissions for everything in the storage
directory:
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 cache
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 formatter
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 less
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 locale
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 logs
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 sessions
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 tmp
drwxrwxr-x 2 myuser myuser 4096 Dec 6 00:27 views
Of course, I could very likely fix this problem by changing the above permissions, but I'm worried that'd just band-aid over some more fundamental problem that happened during installation/upgrade. Or is setting permissions simply a step that is missing from the installation instructions?
Thanks for your help!