8

I have tried everything but I not able to fix this error. I installed PHP by downloading it and then ran:

brew install php55-mcrypt

I had initially installed it with PHP 5.3 then Laravel complained that it has to be greater than 5.4. So everything got messed up.

I am on MAC 10.7. Can someone help me?

php -v

PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
PHP 5.5.1 (cli) (built: Aug 14 2013 10:31:02) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
2
  • 1
    This doesn't go to solve your immediate issue, but consider using Vagrant or another VM-based solution so you don't have to go through this type of stuff on your Macintosh. It's very non-standard Posix-ish setup causes all sorts of trouble :D net.tutsplus.com/tutorials/php/vagrant-what-why-and-how Commented Aug 14, 2013 at 21:42
  • no one can answer this? Commented Jul 31, 2014 at 10:33

3 Answers 3

14

brew reinstall mcrypt --build-from-source php56-mcrypt --build-from-source

Build from source is an option which will force brew to compile from source rather than using a bottle.

Sign up to request clarification or add additional context in comments.

1 Comment

Error: No available formula with the name "php56-mcrypt"
0

Since you had a previous installation of PHP (5.3), and now you just installed a newer version (5.5.1), maybe the new PHP installation are pointing to some old locations.

Look for any php.ini you're using, and verify the extension_dir directive.

The last suggestion would be to reinstall PHP 5.5.1.

3 Comments

Thanks for the suggestion .. But I have updated the extention_dir entry in the php.ini .. but did not change anything .. still getting the error ..
Also I have reinstalled PHP 5.5 but no progress .. :(
Strange... Seems like I can't be of help.
0

The warning is because of mismatch between php-mcrypt module version and php version in the server. I am not that familiar with brew as I am a Macports user however depending on your unix ditro you can do something like:

=======

yum list installed | grep php55

=======

Sample output:
=======
php55-gd.x86_64                        5.2.14-2.el5.art                   installed
php55-imap.x86_64                      5.2.14-2.el5.art                  installed
php55-mbstring.x86_64                  5.2.14-2.el5.art                installed
**php55-mcrypt.x86_64                    5.1.6-15.el5.centos.1        installed**
php55-mysql.x86_64                     5.2.14-2.el5.art                  installed
=======

We can see the php-mcrypt module associated with earlier version of PHP.

How to fix the error?

Update php-mcrypt module to fix the error.

======

yum update php-mcrypt

======

hope that helps

2 Comments

He uses MAC OS X and not RHEL/Fedora, so using yum would really help
oups, it should obviously be wouldn't.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.