Skip to content
Advertisement

Dokku: PHP extension mbstring is missing when deploying Laravel application

I am still getting this error below saying that PHP extension mbstring is missing when deploying my Laravel application (version 6.17.1) using Dokku (version 0.18.3) even though I have followed the documentation (https://devcenter.heroku.com/articles/php-support#using-optional-extensions).

JavaScript

What I have tried:

  1. Update composer.json
JavaScript
  1. Run composer update
  2. git add and git commit both composer.json and composer.lock files before deploying

Any help is appreciated, thanks!

Advertisement

Answer

Issue solved, here are the steps:

  1. Make sure your app uses these 2 buildpacks:
JavaScript
  1. Create a new file Aptfile on root directory with content as below:
JavaScript
  1. git add, git commit and deploy, it should work now

References:

  1. Answer reference and more detail: https://github.com/gliderlabs/herokuish/issues/529#issuecomment-592938477
  2. https://github.com/heroku/heroku-buildpack-apt
  3. https://github.com/heroku/heroku-buildpack-php
  4. How to set/add buildpacks in dokku: https://github.com/dokku/dokku/blob/master/docs/deployment/methods/buildpacks.md
  5. About Aptfile: https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement