PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, March 6, 2022

[FIXED] Running Composer with MAMP: Unable to load dynamic library mcrypt.so

 March 06, 2022     composer-php, mamp, mcrypt, php     No comments   

Issue

I am attempting to get composer running on my Mac and using MAMP. I installed composer using

sudo curl -sS https://getcomposer.org/installer | phpmamp

So, in .bash_profile, I've added the following alias

alias phpmamp='/Applications/MAMP/bin/php/php5.5.14/bin/php'

After installing, I also moved composer.phar to /usr/local/bin/composer

Now I try to run composer and I get the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so' - dlopen(/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so, 9): Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
  Referenced from: /usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so
  Reason: image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so' - dlopen(/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so, 9): Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
  Referenced from: /usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so
  Reason: image not found in Unknown on line 0
??+?%

Here's my php version info:

PHP 5.5.14 (cli) (built: Jul 25 2014 17:02:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

I've tried adding the following to my bash_profile with no luck/difference:

PATH=/Applications/MAMP/bin/php/php5.5.17/bin:$PATH

Solution

You're trying to load PHP 5.3 libraries into a PHP 5.5 installation. You need to install a PHP 5.5 version of mcrypt. If you're using Homebrew to manage your PHP install (which you should), brew install php55-mcrypt will do the trick.



Answered By - ceejayoz
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing