Possibly you use higher version of php CLI you use to run composer install on command line, than php version on Webserver configuration (this occasionally happen).
You just need to set the webserver configuration to use the same php CLI version you use on command line.