title: Dokku: PHP extension mbstring is missing when deploying Laravel application
body: <p>I am still getting this error below saying that PHP extension <code>mbstring</code> is missing when deploying my Laravel application (version <code>6.17.1</code>) using Dokku (version <code>0.18.3</code>) even though I have followed the documentation (<a href="https://devcenter.heroku.com/articles/php-support#using-optional-extensions" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/php-support#using-optional-extensions</a>).</p>
  
  <pre class="lang-sh prettyprint-override"><code>-----&gt; Cleaning up...
  -----&gt; Building laravel-app from herokuish...
  -----&gt; Adding BUILD_ENV to build environment...
  -----&gt; Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
         Detected buildpacks: multi nodejs php
  -----&gt; Multipack app detected
  =====&gt; Downloading Buildpack: https://github.com/heroku/heroku-buildpack-php.git
  =====&gt; Detected Framework: PHP
  remote: -----&gt; Bootstrapping...
  remote: -----&gt; Installing platform packages...
  remote:        - php (7.4.3)
  remote:        - ext-mbstring (bundled with php)
  remote:        - apache (2.4.41)
  remote:        - nginx (1.16.1)
  remote: PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so (libonig.so.4: cannot open shared object file: No such file or directory), /app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so.so (/app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  remote: PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so (libonig.so.4: cannot open shared object file: No such file or directory), /app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so.so (/app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  remote: -----&gt; Installing dependencies...
  remote:        Composer version 1.9.3 2020-02-04 12:58:49
  remote:        PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so (libonig.so.4: cannot open shared object file: No such file or directory), /app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so.so (/app/.heroku/php/lib/php/extensions/no-debug-non-zts-20190902/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  remote:        Loading composer repositories with package information
  remote:        Installing dependencies from lock file
  remote:        Your requirements could not be resolved to an installable set of packages.
  remote:        
  remote:          Problem 1
  remote:            - The requested PHP extension ext-mbstring * is missing from your system. Install or enable PHP's mbstring extension.
  remote:          Problem 2
  remote:            - Installation request for laravel/framework v6.17.1 -&gt; satisfiable by laravel/framework[v6.17.1].
  remote:            - laravel/framework v6.17.1 requires ext-mbstring * -&gt; the requested PHP extension mbstring is missing from your system.
  remote:          Problem 3
  remote:            - Installation request for league/commonmark 1.3.1 -&gt; satisfiable by league/commonmark[1.3.1].
  remote:            - league/commonmark 1.3.1 requires ext-mbstring * -&gt; the requested PHP extension mbstring is missing from your system.
  remote:          Problem 4
  remote:            - Installation request for sentry/sentry 2.3.1 -&gt; satisfiable by sentry/sentry[2.3.1].
  remote:            - sentry/sentry 2.3.1 requires ext-mbstring * -&gt; the requested PHP extension mbstring is missing from your system.
  remote:          Problem 5
  remote:            - laravel/framework v6.17.1 requires ext-mbstring * -&gt; the requested PHP extension mbstring is missing from your system.
  remote:            - sentry/sentry-laravel 1.7.0 requires illuminate/support 5.0 - 5.8 | ^6.0 | ^7.0 -&gt; satisfiable by laravel/framework[v6.17.1].
  remote:            - Installation request for sentry/sentry-laravel 1.7.0 -&gt; satisfiable by sentry/sentry-laravel[1.7.0].
  remote:        
  remote:          To enable extensions, verify that they are enabled in your .ini files:
  remote:            - /app/.heroku/php/etc/php/php.ini
  remote:            - /app/.heroku/php/etc/php/conf.d/000-heroku.ini
  remote:            - /app/.heroku/php/etc/php/conf.d/010-ext-zend_opcache.ini
  remote:            - /app/.heroku/php/etc/php/conf.d/100-ext-mbstring.ini
  remote:            - /tmp/buildpackKITei/conf/php/apm-nostart-overrides/apm-nostart-overrides.ini
  remote:          You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
  remote: 
  remote:  !     ERROR: Dependency installation failed!
  remote:  !     
  remote:  !     The 'composer install' process failed with an error. The cause
  remote:  !     may be the download or installation of packages, or a pre- or
  remote:  !     post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
  remote:  !     in your 'composer.json'.
  remote:  !     
  remote:  !     Typical error cases are out-of-date or missing parts of code,
  remote:  !     timeouts when making external connections, or memory limits.
  remote:  !     
  remote:  !     Check the above error output closely to determine the cause of
  remote:  !     the problem, ensure the code you're pushing is functioning
  remote:  !     properly, and that all local changes are committed correctly.
  remote:  !     
  remote:  !     For more information on builds for PHP on Heroku, refer to
  remote:  !     https://devcenter.heroku.com/articles/php-support
  remote: 
  </code></pre>
  
  <p>What I have tried:</p>
  
  <ol>
  <li>Update <code>composer.json</code></li>
  </ol>
  
  <pre><code>{
      "name": "laravel/laravel",
      "type": "project",
      "description": "The Laravel Framework.",
      "keywords": [
          "framework",
          "laravel"
      ],
      "license": "MIT",
      "require": {
          "php": "^7.2",
          "ext-mbstring": "*",
          "aws/aws-sdk-php": "^3.133",
          "fideloper/proxy": "^4.0",
          "laravel/framework": "^6.2",
          "laravel/tinker": "^2.0",
          "sentry/sentry-laravel": "^1.6"
      },
      "require-dev": {
          "facade/ignition": "^1.4",
          "fzaninotto/faker": "^1.9.1",
          "mockery/mockery": "^1.0",
          "nunomaduro/collision": "^3.0",
          "phpunit/phpunit": "^8.0"
      },
      "config": {
          "optimize-autoloader": true,
          "preferred-install": "dist",
          "sort-packages": true
      },
      "extra": {
          "laravel": {
              "dont-discover": []
          }
      },
      "autoload": {
          "psr-4": {
              "App\\": "app/"
          },
          "classmap": [
              "database/seeds",
              "database/factories"
          ]
      },
      "autoload-dev": {
          "psr-4": {
              "Tests\\": "tests/"
          }
      },
      "minimum-stability": "dev",
      "prefer-stable": true,
      "scripts": {
          "post-autoload-dump": [
              "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
              "@php artisan package:discover --ansi"
          ],
          "post-root-package-install": [
              "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
          ],
          "post-create-project-cmd": [
              "@php artisan key:generate --ansi"
          ]
      }
  }
  </code></pre>
  
  <ol start="2">
  <li>Run <code>composer update</code></li>
  <li><code>git add</code> and <code>git commit</code> both <code>composer.json</code> and <code>composer.lock</code> files before deploying</li>
  </ol>
  
  <p>Any help is appreciated, thanks!</p>