title: MediaWiki on Heroku: mbstring, intl PHP extensions missing
body: <p>I'm trying to install MediaWiki on Heroku, and I'm running into a PHP issue. I'm using the <a href="https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-php" rel="nofollow noreferrer">heroku/php build pack</a>.</p>
  <p>MediaWiki says:</p>
  <blockquote>
  <h1>MediaWiki 1.39 internal error</h1>
  <p>Installing some PHP extensions is required.</p>
  <h2>Required components</h2>
  <p>You are missing a required extension to PHP that MediaWiki requires to
  run. Please install:</p>
  <ul>
  <li><strong>mbstring</strong> (<a href="https://www.php.net/mbstring" rel="nofollow noreferrer">more information</a>)</li>
  <li><strong>intl</strong> (<a href="https://www.php.net/intl" rel="nofollow noreferrer">more information</a>)</li>
  </ul>
  </blockquote>
  <p><code>composer u</code> throws:</p>
  <pre class="lang-sh prettyprint-override"><code>~ $ composer u
  &gt; ComposerHookHandler::onPreUpdate
  Loading composer repositories with package information
  Info from https://repo.packagist.org: #StandWithUkraine
  Updating dependencies
  Your requirements could not be resolved to an installable set of packages.
  
    Problem 1
      - Root composer.json requires PHP extension ext-calendar * but it is missing from your system. Install or enable PHP's calendar extension.
    Problem 2
      - Root composer.json requires wikimedia/html-formatter 3.0.1 -&gt; satisfiable by wikimedia/html-formatter[3.0.1].
      - wikimedia/html-formatter 3.0.1 requires ext-mbstring * -&gt; it is missing from your system. Install or enable PHP's mbstring extension.
    Problem 3
      - Root composer.json requires wikimedia/remex-html 3.0.1 -&gt; satisfiable by wikimedia/remex-html[3.0.1].
      - wikimedia/remex-html 3.0.1 requires ext-mbstring * -&gt; it is missing from your system. Install or enable PHP's mbstring extension.
    Problem 4
      - Root composer.json requires wikimedia/utfnormal 3.0.2 -&gt; satisfiable by wikimedia/utfnormal[3.0.2].
      - wikimedia/utfnormal 3.0.2 requires ext-mbstring * -&gt; it is missing from your system. Install or enable PHP's mbstring extension.
    Problem 5
      - Root composer.json requires mediawiki/mediawiki-codesniffer 38.0.0 -&gt; satisfiable by mediawiki/mediawiki-codesniffer[v38.0.0].
      - mediawiki/mediawiki-codesniffer v38.0.0 requires ext-mbstring * -&gt; it is missing from your system. Install or enable PHP's mbstring extension.
    Problem 6
      - Root composer.json requires wmde/hamcrest-html-matchers ^1.0.0 -&gt; satisfiable by wmde/hamcrest-html-matchers[v1.0.0].
      - wmde/hamcrest-html-matchers v1.0.0 requires ext-mbstring * -&gt; it is missing from your system. Install or enable PHP's mbstring extension.
    Problem 7
      - wikimedia/remex-html 3.0.1 requires ext-mbstring * -&gt; it is missing from your system. Install or enable PHP's mbstring extension.
      - wikimedia/parsoid[v0.16.0-a1, ..., v0.16.0-a2] require wikimedia/remex-html ^3.0.0 -&gt; satisfiable by wikimedia/remex-html[3.0.1].
      - Root composer.json requires wikimedia/parsoid ^0.16.0-a1@alpha -&gt; satisfiable by wikimedia/parsoid[v0.16.0-a1, v0.16.0-a2].
  
  To enable extensions, verify that they are enabled in your .ini files:
      - /app/.heroku/php/etc/php/php-cli.ini
      - /app/.heroku/php/etc/php/conf.d/000-heroku.ini
      - /app/.heroku/php/etc/php/conf.d/010-ext-zend_opcache.ini
  You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
  Alternatively, you can run Composer with `--ignore-platform-req=ext-calendar --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-mbstring` to temporarily ignore these required extensions.
  
  Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
  </code></pre>
  <p>I tried un-commenting-out the mbstring and intl lines in <code>php.ini</code>, but changes didn't stick; Heroku seems to over-write the file.</p>
  <p>I also tried creating a <code>.user.ini</code> <a href="https://devcenter.heroku.com/articles/custom-php-settings#php-runtime-settings" rel="nofollow noreferrer">which Heroku documentation suggests</a>. I put these lines in <code>~/.user.ini</code>:</p>
  <pre class="lang-php prettyprint-override"><code>extension=mbstring
  extension=intl
  </code></pre>
  <p>but I still get the MediaWiki &quot;required components&quot; error.</p>