2

I’ve suddenly started having problems with Craft on Heroku. It worked fine for a while but if I composer install anything later than Craft 3.2 I get the same error back from Heroku:

2020-02-21T01:22:32.775659+00:00 heroku[router]: at=info method=GET path="/" host=connor-heroku-test.herokuapp.com request_id=7df849c1-4f9b-46f3-aaba-2bf88e0f0b1e fwd="151.226.158.115" dyno=web.1 connect=0ms service=52ms status=500 bytes=182 protocol=https
2020-02-21T01:22:32.775695+00:00 app[web.1]: [21-Feb-2020 01:22:32 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function mb_regex_encoding() in /app/vendor/voku/portable-utf8/src/voku/helper/UTF8.php:490
2020-02-21T01:22:32.775707+00:00 app[web.1]: Stack trace:
2020-02-21T01:22:32.775896+00:00 app[web.1]: #0 /app/vendor/voku/portable-utf8/bootstrap.php(7): voku\helper\UTF8::checkForSupport()
2020-02-21T01:22:32.776075+00:00 app[web.1]: #1 /app/vendor/composer/autoload_real.php(66): require('/app/vendor/vok...')
2020-02-21T01:22:32.776292+00:00 app[web.1]: #2 /app/vendor/composer/autoload_real.php(56): composerRequiredcd24579acb46ca3092f278cf90a0024()
2020-02-21T01:22:32.776510+00:00 app[web.1]: #3 /app/vendor/autoload.php(7): ComposerAutoloaderInitdcd24579acb46ca3092f278cf90a0024::getLoader()
2020-02-21T01:22:32.776658+00:00 app[web.1]: #4 /app/web/index.php(11): require_once('/app/vendor/aut...')
2020-02-21T01:22:32.776702+00:00 app[web.1]: #5 {main}
2020-02-21T01:22:32.776885+00:00 app[web.1]: thrown in /app/vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 490
2020-02-21T01:22:32.777446+00:00 app[web.1]: 10.32.124.137 - - [21/Feb/2020:01:22:32 +0000] "GET / HTTP/1.1" 500 5 "https://dashboard.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15

Every version I’ve tried works fine on local.

Any ideas about what I can do to sort this?

Thanks!

2

This bit us a few days ago, as well.

As far as I could tell from the build log, the cause was that Heroku bumping their PHP version from 7.3.x to 7.4.x, and exposing an incompatibility with one of Craft's dependencies.

To lock your PHP version to a 7.3.x release on the Heroku stack, just add this to your composer.json:

{
  // ...
  "require": {
    "php": "~7.3.0"
    // ...
  }
  // ...
}
1
  • 1
    Ah, that's sorted it - thank you. I'll check back in the near future to see if these dependencies have sorted themselves out.
    – Connor
    Feb 21 '20 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.