Amazon linux2でphp-mbstring有効化

WordPressのプラグインであるWP Cerber Securityをインストールした時にこのようなエラーが出てしましたました。

エラー: A PHP extension mbstring is not enabled on this website. Some plugin features will not work properly. You need to enable the PHP mbstring extension (multibyte string support) in your hosting control panel


amazon-linux-extras でインストールすると、php-mbstringが入っていませんでしたので別途インストールします

$ sudo amazon-linux-extras install php7.2
$ sudo yum install php-mbstring


$ sudo vim /etc/php.ini




; language for internal character representation.
; This affects mb_send_mail() and mbstring.detect_order.
mbstring.language = Japanese ←コメントを外して入力

; Use of this INI entry is deprecated, use global internal_encoding instead.
; internal/script encoding.
; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)
; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
mbstring.internal_encoding = UTF-8 ←コメントを外して入力

; Use of this INI entry is deprecated, use global input_encoding instead.
; http input encoding.
; mbstring.encoding_traslation = On is needed to use this setting.
; If empty, default_charset or input_encoding or mbstring.input is used.
; The precedence is: default_charset < intput_encoding < mbsting.http_input
mbstring.http_input = auto ←コメントを外して入力

; Use of this INI entry is deprecated, use global output_encoding instead.
; http output encoding.
; mb_output_handler must be registered as output buffer to function.
; If empty, default_charset or output_encoding or mbstring.http_output is used.
; The precedence is: default_charset < output_encoding < mbstring.http_output
; To use an output encoding conversion, mbstring's output handler must be set
; otherwise output encoding conversion cannot be performed.
mbstring.http_output = UTF-8 ←コメントを外して入力

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
;       portable libs/applications.
mbstring.encoding_translation = On ←コメントを外して入力

; automatic encoding detection order.
; "auto" detect order is changed according to mbstring.language
mbstring.detect_order = auto ←コメントを外して入力