3

Is there a way to compile the PHP extension mbstring statically into PHP (PHP >= 7)? Something like ./configure [...] --enable-mbstring=static [...] && make?

devopsfun
  • 1,368
  • 2
  • 15
  • 37
  • Have you actually tried `./configure --enable-mbstring` ? It embeds the extension into the PHP binary. – IVO GELOV Jul 17 '18 at 11:14
  • @IVOGELOV: Yes, I tried this. But I have the problem, that I compile PHP on my own and I need now also the `mbstring.so`, but I cannot find any information, how to the this `mbstring.so`. When I install it with `yum install php-mbstring`, I only get the one compiled against `PHP 5.6`. – devopsfun Jul 17 '18 at 11:22
  • When you embed the extension - there is no `mbstring.so`, only `php`. If you do not embed the extension but compile it separately - then you get the SO file but in this case you must add it as `extension=mbstring.so` in your `php.ini` – IVO GELOV Jul 17 '18 at 11:27
  • @IVOGELOV Do you know how to embed `mbstring` into PHP? This is what my initial question is about... – devopsfun Jul 17 '18 at 12:46
  • Yes - you simply issue `./configure --enable-mbstring && make` and you have a `php` binary with `mbstring` embedded inside it. – IVO GELOV Jul 17 '18 at 12:58
  • I configure like this with -enable-mbstring and rebuild `composer` and still get errors like this with composer: `stefanak-michal/bolt v2.1 requires ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.` – Brian Wiley Dec 31 '20 at 15:25

0 Answers0