JustDev Flarum itself requires at least PHP 7.1, so I'm not sure how you managed to get it installed without encountering this.
However, Ubuntu 16(.04 I assume) will not have PHP 7.1+ in its repositories, you'll have to add a ppa in order to use the newer PHP versions on that OS. Search the web, I'm certain someone has detailed how to do it (DigitalOcean's tutorials or Stack Overflow are good places to look).
If you already have a higher version of PHP installed, you can run php -v
to see what the console is returning. You may need to change the PHP path or call the specific version of php from location when running composer
commands (which might be something like /usr/bin/php7 composer ...
).