Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mattysmart's avatar

ext-mcrypt * -> the requested PHP extension mcrypt is missing

Ive pulled down changes from beanstalk. and now i get:

Class 'Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider' not found

So trying to do a composer update which fails. I cd into the root directory of the project then run composer update which throws this:

laravel/framework v5.0.31 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

i do not know how to resolve this, and everything i try on posts do not work, however if i cd .. out 1 directory it works just fine.

0 likes
6 replies
ian_h's avatar

@mattysmart You'll need to install the mcrypt PHP extension. This is an OS-level extension, not application, so you'll need root / sudo access.

For Debian, I'd simply do:

# apt-get update
# apt-get install php5-mcrypt

then add the mcrypt.so module to my php.ini file if it hadn't done it automagically.

Cheers..

Ian

mattysmart's avatar

When i try this i get zsh:

command not found: apt-get
mattysmart's avatar

osx 10.9.5, i'm not sure what you mean by 'distro' though?

ian_h's avatar

Distro would have referred to a Linux distribution (Debian, Ubuntu, CentOS, etc etc).

I'm not a mac user personally, but have just found this Installing the PHP mcrypt extension on OSX 10.9 blog post that should help?.

If not, then I'm sure one of the many mac experts on here will be along at some point to assist you further =)

Cheers..

Ian

timetraveller1992's avatar

If you have homebrew installed then it’s:

brew install php5-mcrypt

Actually you should figure out which php version you have and based on that install the right mcrypt. So do:

php -v

Then brew search mcrypt.

So if php -v showed 5.6 and mcrypt library php56-mcrypt exists in the search output then:

brew install php56-mcrypt
1 like

Please or to participate in this conversation.