I am trying to change the PHP version that my heroku application uses from the default 7.1 to 7.0. When I try to define it in composer.json
it is ignored. What do I need to do?
Apart from updating composer file, if your application requires "php": ^5.6.0" or 7.0.32 you need to make sure that, heroku stack that you are using is 'heroku-16' and not 'heroku-18'.
Run heroku stack
in CLI to get the info. By default, it is set to 'heroku-18' which is the latest version and uses Ubuntu 18.04 with PHP 7.2 installed.
If it is on 'heroku-18', use command heroku stack:set heroku-16
to toggle.
P.S: PHP versions 5.6 and 7.0 will reach end-of-life at the end of 2018. No bugfixes, including critical security fixes, will be provided by the PHP maintainers after this date. Users are strongly encouraged to update their applications to the latest version of PHP 7.2 at their earliest convenience. For more information on support timelines for PHP releases, refer to the Supported Versions page on the official PHP website.
From Selecting a runtime, you need to use composer.json
and specify the PHP version there:
{
"require": {
"php": "^5.6.0"
}
}
In your case, please have:
{
"require": {
"php": "7.0.0"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With