<p>This bit us a few days ago, as well.</p>

<p>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.</p>

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

<pre><code>{
  // ...
  "require": {
    "php": "~7.3.0"
    // ...
  }
  // ...
}
</code></pre>

CC BY-SA 4.0
2020-02-21T10:08:53.040Z
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
CC BY-SA 4.0
2020-02-21T01:46:48.257Z
2020-02-21T01:46:48.257Z
August Miller
<p>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:</p>

<pre><code>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
</code></pre>

<p>Every version I’ve tried works fine on local. </p>

<p>Any ideas about what I can do to sort this? </p>

<p>Thanks!</p>

<heroku>
Craft suddenly no longer works on Heroku
# Craft suddenly no longer works on Heroku

(Asked by: username_0 on 2020-02-21)

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!

**Tags:** heroku

---

## 1 answers

### Answer by username_1 on 2020-02-21. Score: 2 | Accepted answer

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"
    // ...
  }
  // ...
}

> **Comments:**
> **username_0**: Ah, that's sorted it - thank you. I'll check back in the near future to see if these dependencies have sorted themselves out.  

---

