After upgrading php from 5.1 to 5.2.10, I got the following warnings when php -v:
# php -v
PHP Warning: PHP Startup: fileinfo: Unable t
brew reinstall php56-mcrypt --build-from-source
Do this—pass the --build-from-source flag—for each module which needs to be compiled with the same version.
It may also require PHP options depending on your plugins. If so, brew reinstall php56 --with-thread-safety
To see all of the options for php[version] run brew options php56 (replacing 56 with your version)