Laravelのインストールでmbstringがないと怒られたら

# 結論
これらをインストールすればおk

```
sudo yum install --enablerepo=remi-php72 php-mbstring php-openssl php-xml unzip
```

# 作業ログ

環境は CentOS7です。

ドットインストールを参考にしつつ、
composerコマンドをダウンロードしました。

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

そして、下記コマンドを実行！

```
php composer.phar create-project --prefer-dist laravel/laravel myblog
```

...するとエラーが発生。

```
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.7.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.7.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 5.7.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.7.* -> satisfiable by laravel/framework[5.7.x-dev, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.12, v5.7.13, v5.7.14, v5.7.15, v5.7.16, v5.7.2, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php.ini
    - /etc/php.d/20-bz2.ini
    - /etc/php.d/20-calendar.ini
    - /etc/php.d/20-ctype.ini
    - /etc/php.d/20-curl.ini
    - /etc/php.d/20-exif.ini
    - /etc/php.d/20-fileinfo.ini
    - /etc/php.d/20-ftp.ini
    - /etc/php.d/20-gettext.ini
    - /etc/php.d/20-iconv.ini
    - /etc/php.d/20-json.ini
    - /etc/php.d/20-mysqlnd.ini
    - /etc/php.d/20-pdo.ini
    - /etc/php.d/20-phar.ini
    - /etc/php.d/20-sockets.ini
    - /etc/php.d/20-sqlite3.ini
    - /etc/php.d/20-tokenizer.ini
    - /etc/php.d/30-mysqli.ini
    - /etc/php.d/30-pdo_mysql.ini
    - /etc/php.d/30-pdo_sqlite.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
```

なので、yumを使ってダウンロードしてあげる。私の環境はPHP7.2なので、下記コマンドを実行。

```
sudo yum install --enablerepo=remi-php72 php-mbstring php-openssl
```

myblog ディレクトリ自体はすでに出来ているので一度削除

```
rm -rf myblog
```

その上で、再度composerコマンドを実行。

```
  Problem 1
    - phpunit/phpunit 7.5.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.3.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.3.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.3.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.3.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.3.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.3.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.1.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.1.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.1.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 7.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - Installation request for phpunit/phpunit ^7.0 -> satisfiable by phpunit/phpunit[7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.5, 7.4.0, 7.4.1, 7.4.2, 7.4.3, 7.4.4, 7.4.5, 7.4.x-dev, 7.5.0, 7.5.x-dev].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php.ini
    - /etc/php.d/20-bz2.ini
    - /etc/php.d/20-calendar.ini
    - /etc/php.d/20-ctype.ini
    - /etc/php.d/20-curl.ini
    - /etc/php.d/20-exif.ini
    - /etc/php.d/20-fileinfo.ini
    - /etc/php.d/20-ftp.ini
    - /etc/php.d/20-gettext.ini
    - /etc/php.d/20-iconv.ini
    - /etc/php.d/20-json.ini
    - /etc/php.d/20-mbstring.ini
    - /etc/php.d/20-mysqlnd.ini
    - /etc/php.d/20-pdo.ini
    - /etc/php.d/20-phar.ini
    - /etc/php.d/20-sockets.ini
    - /etc/php.d/20-sqlite3.ini
    - /etc/php.d/20-tokenizer.ini
    - /etc/php.d/30-mysqli.ini
    - /etc/php.d/30-pdo_mysql.ini
    - /etc/php.d/30-pdo_sqlite.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
```

**次は ext-domがないと怒られた。** インストール。

```
sudo yum install --enablerepo=remi-php72 php-xml
```

これで怒られないだろう。。。。

```
Failed to download laravel/laravel from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php --ini` to show them.
    Now trying to download from source
```

**まだ怒られた。**もう勘弁して。。。
解凍出来ない！と言われたので

```
sudo yum install --enablerepo=remi-php72 unzip
```

これでやっとインストールがいけました！

```
[vagrant@localhost myblog]$ php artisan --version
Laravel Framework 5.7.16
```

元気に起動してくれました