I meet the same problem and I solved.
my env:
previous php version: 7.0.x
mysql: 5.7.24
So I upgrade the php to 7.2, and the error appeared: Error booting Flarum: syntax error, unexpected '?', expecting variable (T_VARIABLE)
Then I tried reinstalled php7.2, and failed again.
So I uninstall all php related packages.
sudo apt-get remove php*
Be carefully, this command is dangerous.
And reinstall php7.2 and it's required php extensions. Then restart the apache.
It works.