Flarum on Docker
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.2.34. in /var/www/vendor/composer/platform_check.php on line 24
- Edited
zhuhoudong this is an old tutorial (Flarum moves quickly from beta to beta and major breaking changes were released during 2020). It might not be compatible with the latest Flarum version.
That being said, what command gives you the error you shared? Flarum does not (yet) requires PHP 7.3 as of beta 14, so it's probably another package that's causing the issue.
clarkwinkelmann thanks!
I refered to the following page:
https://discuss.flarum.org/d/22011-flarum-on-docker
Could you please tell me the correct docker image and tutorial? Thanks!
zhuhoudong I access the page from browser: http://localhost:8080/
after executing the command " docker-compose up -d " and after the docker container starts .
zhuhoudong Hi, from the top of my head, try this:
- edit the first line of
flarum-fpm.dockerfile
to update PHP version (from 7.2 to 7.3) - rebuild the image
- run
docker-compose up -d
I think this should solve the PHP dependency issue.
nadi106 Thanks. New issue:
Warning: file_put_contents(/var/www/public/../storage/sessions/46OJsvuTjdB9XTW20dY3SdETwebCJpXXs1UbuPTZ): failed to open stream: Permission denied in /var/www/vendor/illuminate/filesystem/Filesystem.php on line 133
Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Unable to emit response; headers already sent in /var/www/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:19 Stack trace: #0 /var/www/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(36): Laminas\HttpHandlerRunner\Exception\EmitterException::forHeadersSent() #1 /var/www/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput() #2 /var/www/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(98): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(Laminas\Diactoros\Response\HtmlResponse)) #3 /var/www/vendor/flarum/core/src/Http/Server.php(42): Laminas\HttpHandlerRunner\RequestHandlerRunner->run() #4 /var/www/public/index.php(22): Flarum\Http\Server->listen() #5 {main} thrown in /var/www/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php on line 19
zhuhoudong solved:
[root@monitorcenter flarum]# cd ..
[root@monitorcenter wwwroot]# chmod -R 777 flarum
[root@monitorcenter wwwroot]# cd flarum/
zhuhoudong chmod
-ing with 777
permissions is not recommended and possesses a security concern. Consider fixing the issue by having the files owned by the proper user/group (sometimes www-data
but may vary)
nadi106 Thanks very much!
nadi106 The Docker Flarum is installed and ready to use. But how can I change the English interface to the Chinese interface?
Need to recreate the image, or is there any other way to install the plugin in the container? Thank you for your hint。
zhuhoudong install plugins using Composer. I believe plugins are installed in some directory under the git directory, so installing them regularly should work.
I'm having the following error:
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.2.34. in /var/www/vendor/composer/platform_check.php on line 24
not sure how to solve it yet though...
feefladder seems the php version is different between terminal and web.
ok, so I'm abandoning this approach. in the pull request that the repository links to, they give an amazing alternative:
https://github.com/mondediefr/docker-flarum
so trying that now