I've successfully installed mcrypt
via homebrew
but I'm struggling to find the path to mcrypt.so
to include it as an extension in php.ini
.
mcrypt was installed at /usr/local/Cellar/mcrypt/2.5.8
. Tree:
-- AUTHORS
|-- ChangeLog
|-- INSTALL_RECEIPT.json
|-- NEWS
|-- README
|-- TODO
|-- bin
| `-- libmcrypt-config
|-- include
| |-- mcrypt.h
| `-- mutils
| `-- mcrypt.h
|-- lib
| |-- libmcrypt.4.4.8.dylib
| |-- libmcrypt.4.dylib -> libmcrypt.4.4.8.dylib
| `-- libmcrypt.dylib -> libmcrypt.4.4.8.dylib
`-- share
|-- aclocal
| `-- libmcrypt.m4
`-- man
`-- man3
`-- mcrypt.3
I tried to include mcrypt.h
in php.ini
:
extension="/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h"
and then restarted apache. but it didn't work.
when I run php in the terminal I get:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h' - dlopen(/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h, 9):
image not found in Unknown on line 0
Worked like a piece of cake with this.
Then test it out:
First check if brew is up-to-date:
brew doctor
Second install mcrypt based on php version:
brew install php53-mcrypt
NB: Step three below is not required on recent versions of brew:
Third open php.ini file and add reference:
sudo vi /private/etc/php.ini
extension="/usr/local/Cellar/php53-mcrypt/5.3.25/mcrypt.so"
Finally, restart apache:
sudo apachectl restart
This may prove useful...
After wondering for hours through different advices, this one worked for me (Installed via MacPorts):
Courtesy of Chris Brewer:
Download and install MacPorts from
http://macports.org.
The following steps are performed in the Terminal:
Force MacPorts to update (will only work if Apple's Xcode installed):
Now, install memcached:
Copy the newly created shared object for mcrypt into Mac OS X’s default PHP5 extension directory:
Next, you need to edit php.ini to add the extensions. Find the phrase Dynamic Extensions, and add:
And finally, restart Apache:
sudo apachectl restart
I've solved the problem with this
Then I add this line to
/etc/php.ini
.If this file doesn't exists you'll need to copy it from
/etc/php.ini.default
. Also I check the version of my php withphp -v
(And it was 5.4.x)I appreciate the work you did on this! This worked for me. I am on a mac and it was looking for xcode. The Developer location hadn't been set so I had to do all of this.
(RESOLVE THE DEVELOPER PATH) How can I resolve "Error: No developer directory found at /Developer"?
(SIGN THE AGREEMENT TO USE XCODE)
Lastly follow the above steps!