0

As some of you might know, PHP version ≥7.2 has an issue regarding count: count(): parameter must be an array or an object that implements Countable and this does contributes to a lot of problems.

I'm using the PHP framework Laravel 5.3 on Heroku, which until the change of PHP version worked perfectly fine. So why don't I just change the PHP version? Well, according to the docs I'm supposed to just change the version in my composer.json, run composer update and everything will be fine but no - I'm getting this error:

Your requirements could not be resolved to an installable set of packages.

Problem 1 - This package requires php ^5.6.4 but your PHP version (7.2.1) does not satisfy that requirement.

Anyone knowing anything that can contribute solving my problem?

Rikard Olsson
  • 841
  • 1
  • 7
  • 28

1 Answers1

1

You also need to push composer.lock.

  1. Change the version in your local and make $ composer update.
  2. Make sure you have changed composer.lock.
  3. Push both files on Heroku.

From the documentation, https://devcenter.heroku.com/articles/php-support#php-runtimes

Next, ensure that your new requirements are “frozen” to composer.lock by running:

$ composer update

Finally, don’t forget to git add and git commit both files!

Hope this helps.