Mac version MCrypt installation process record

Source: Internet
Author: User


Recently developed the machine replaced with a Mac, suddenly switched over to find some do not adapt, used to be xampp in the WinDOS, in fact, there are xampp in the Mac, just because the Mac bought when it comes with PHP and Apache will not bother to uninstall re-installed XAMPP, And for oneself to use this kind of clean environment to need what again to install what will let oneself to the system of understanding one more point.

So to the point, this time the problem is MCrypt installation, the company's project used this component, Aesdecrypt requires PHP mcrypt extension to being loaded in order to use data Encrypti On feature. The discovery encountered this error, according to the error prompts can know is missing PHP mcrypt extension This component, and then the various search, found that the direct search for this error is to introduce some of the role of this component, there is no way to solve the problem of this error, And then began to search about the installation of this component of the process, found that Baidu is not too good article, then can only change Google, after efforts finally found an article, is English, in my efforts finally installed successfully, the following process to share to everyone

My Mac version is 10.10 Maybe you see this article at the time and my version is not the same, so~ you want to download the appropriate version for yourself, this is the premise.

Next we need to create the MCrypt directory

CD ~; mkdir MCrypt; CD MCrypt
Next we are going to download two things, a PHP extension for this component and the corresponding PHP program
Download the two to the directory we created

The following command about the version number remember to replace it with its own version
CD ~/mcrypt

TAR-ZXVF libmcrypt-2.5.8.tar.gz
TAR-ZXVF php-5.5.9.tar.gz

You can delete the compressed package file after the decompression is complete.
RM *.gz

The next step is to configure Libmcrypt
CD libmcrypt-2.5.8
sudo make install

Next you need to install autoconf
CD ~/mcrypt
Tar Xvfz autoconf-latest.tar.gz
CD autoconf-2.69/
sudo make install

Then compile MCrypt's PHP extension
Cd.. /php-5.5.9/ext/mcrypt/
When you do this, you should output a similar message if it is correct, because the version may be slightly different
Configuring for:
PHP Api version:20121113
Zend Module Api no:20121212
Zend Extension Api no:220121212
sudo make install

Here we have the basic installation completed, if successful, you should see similar information
Installing Shared extensions:/usr/lib/php/extensions/no-debug-non-zts-20121212/

The next step is to add this extension to the/etc/php.ini.
If you don't have a php.ini file, you need to do it, omit the step if it exists.
sudo cp/etc/php.ini.default/etc/php.ini
sudo chmod u+w/etc/php.ini

sudo vi/etc/php.ini

and restart Apache.
sudo apachectl restart

Write a phpinfo in PHP () to see if successful, you should be able to see the mcrypt extension, we have a problem can contact me, qq731907054

Mac version MCrypt installation process record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: