3
votes

I a running a local development environment on my MBP using osx yosemite, php 5.5.14, apache 2.4 mysql (sometimes) and a few things installed via brew.

I tried to run a CMS locally and ran into an issue where it stated i needed mcrypt; so i tried to install it and was promptly tole mcrypt was already installed.

Did a little research, tried to reinstall it and now I'm faced with this error when running php -v. Also this has stopped m dev enviroment from showing me my site and all it says now is 'it works!'

PHP Warning:  PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so' - 
dlopen(/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so, 9): image not
found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 
'/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so' - 
dlopen(/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so, 9): 
image not found in Unknown on line 0
PHP 5.5.21 (cli) (built: Feb 12 2015 20:17:17) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

Any help would be very appreciated and thanks in advance.

1

1 Answers

1
votes

Make sure that you're loading the mcrypt.so extension in your php.ini file. Also, you may need to run brew install mcrypt php55-mcrypt to get the PHP extension.

Find the location of your ini with:

php -i | grep php.ini

Edit the file and add extension=mcrypt.so to the file, save and restart Apache.