LoginSignup
2
0

More than 3 years have passed since last update.

brew の PHP が 7.4 に上がったら Mcrypt PHP extension required. が出たので対応

Posted at

Mac OS X 10.15.2 で brew でインストールした PHP のバージョンが 7.4 に上がった際に一部のプログラムが Mycrypt PHP extension required. で動かなくなったのでその対応

mcrypt の手動 Install

$ wget https://pecl.php.net/get/mcrypt-1.0.1.tgz                                                                                                                                                                                                          
$ tar zxvf mcrypt-1.0.1.tgz
$ cd mcrypt-1.0.1
$ phpize
$ ./configure
$ make 
$ make install
$ rm -rf ../mcrypt-1.0.1*

インストールが完了したら PHP の設定を変更する

$ vim /usr/local/etc/php/php7.4/php.ini
...
extension=mcrypt ; mcrypt を読み込むように設定
...

試したこと

あまり調べていないので単純に設定等が足りないだけの可能性もある

pecl でのインストール

PHP7.3 利用時にインストールしていたものがすでにインストールされているということでインストールできなかった

$ sudo pecl install channel://pecl.php.net/mcrypt-1.0.1
pecl/mcrypt is already installed and is the same as the released version 1.0.1
install failed

pecl での再インストール

PHP7.2 から PHP7.3 でないとインストールできなかった

$ sudo pecl uninstall mcrypt-1.0.1
Extension mcrypt disabled in php.ini
uninstall ok: channel://pecl.php.net/mcrypt-1.0.1
$ pecl install mcrypt-1.0.1
pecl/mcrypt requires PHP (version >= 7.2.0, version <= 7.3.0, excluded versions: 7.3.0), installed version is 7.4.1
No valid packages found
install failed
2
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
2
0