DEV Community

Discussion on: The current state of local Laravel development

Collapse
 
dakira profile image
Matthias Niess

That happens when you have different PHP versions in local and production. E.g. you have PHP8 on your local machine and PHP7.4 in production. When you run composer update, the composer.lock file is created for PHP8. When you run composer install in production, you can't install the dependencies, because they were calculated for your dev machine.

If your server e.g. still runs PHP 7.3, you can run this in your project:

composer config platform.php 7.3.*

It add a section to the composer.json adjusting the dependencies to PHP 7.3. When you run composer update, the composer.lock file will now only get dependencies compatible with your server PHP.