0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

EC2上のLaravelプロジェクトでmbstringが使えない

Posted at

エラー内容

EC2上にデプロイしたらパスワード変更メール送信時に以下のエラーが出た。

Call to undefined function mb_strcut()

原因

ローカルで開発していた時にはデフォルトでmbstringがインストールされていたが、EC2上ではmbstringをインストールしないといけないらしい。

対策

①php-mbstringをインストール
②php.iniを編集
③php-fpmを再起動

①php-mbstringをインストール

sudo yum install php-mbstring

②php.iniを編集

php.iniは記述量が多いので/mbstringで探す。

/etc/php.ini
;mbstring.language = Japanese

mbstring.language = Japanese

;mbstring.internal_encoding = 

mbstring.internal_encoding = UTF-8

;mbstring.http_input =

mbstring.http_input = auto

;mbstring.http_output = 

mbstring.http_output = UTF-8

;mbstring.encoding_translation = OFF

mbstring.encoding_translation = On

;mbstring.detect_order =

mbstring.detect_order = auto

③php-fpmを再起動

sudo systemctl restart php-fpm

これでメールが正常に送信された。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?