< pro-Test to >mac OS Installation mcrypt extension

Source: Internet
Author: User
Tags configuration php install php mcrypt zts zend automake

It is not necessary to mcrypt this library when installing OpenCart in the past. But the new version is needed. Add your own is the MAC environment. At that time trouble, it has not been installed. This afternoon will be thinking about loading it! 1. First you need to install the Xcode tool first. Otherwise, no way to compile! Xcode this can be downloaded from Apple AppStore. 2. Install command line tools to open Xcode .->> Preferences and then click Command Lines Tools install etc to complete the installation can also follow this foreign expert written installation of HTTP S://github.com/kennethreitz/osx-gcc-installer 3. Installing the Autoconf

Cd/tmpcurl-o Http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gztar XVFZ autoconf-latest.tar.gzcd autoconf-2.69 /./configuremakesudo make install (need to enter your password) autoconf--version Verify the installation is successful fyhqytekimacbook-pro:tmp fyhqy$ autoconf-- Versionautoconf (GNU Autoconf) 2.69Copyright (C) free software Foundation, inc.license gplv3+/autoconf:gnu GPL versi On 3 or later, which is the free software:you and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille.

4. Install Libmcrypt first check the PHP version of the machine. The default version of PHP 10.8 installed is 5.3.15.

Fyhqytekimacbook-pro:tmp fyhqy$ php-vphp 5.3.15 with Suhosin-patch (CLI) (Built:aug 17:45:44) Copyright (c) 1997 -2012 the PHP groupzend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

Download the corresponding version of the PHP version package 5.3.15 Source package can go to the page to download. The default is hosted on the Sina SAE

Http://cn2.php.net/distributions/php-5.3.15.tar.gz

This is 5.3.15 Version All

Http://php.net/get/php-5.3.15.tar.gz/from/a/mirrorcurl-O Http://cn2.php.net/distributions/php-5.3.15.tar.gztar ZXVF PHP-5.3.15.TAR.GZCD Php-5.3.15/ext/mcrypt//usr/bin/phpize./configuremakesudo make install

The line may be prompted when compiling

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.

This is because MCrypt is not installed

Curl-o Http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gztar ZXVF LIBMCRYPT-2.5.8.TAR.GZCD libmcrypt-2.5.8./configure--prefix=/usr/local/cellar/mcrypt/2.5.8--mandir=/usr/local/ Cellar/mcrypt/2.5.8/sharmake sudo make install

Then perform the above steps! After the installation is complete, you will be prompted

Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20090626/

Then modify the php.ini. Add the extension to php.ini exists/etc/php.ini

Extension=mcrypt.sosudo apachectl Restart

Reboot under Apache.  Then open phpinfo (); See if it's already installed, eh!

In the loaded MCrypt plugin times wrong, hint: MCrypt fatal error: ' php.h ' File not found

Follow the methods below to resolve the

-s/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10. 9. sdk/usr/include/usr/include

From

http://blog.csdn.net/xfnjlove/article/details/18415441

This problem is met many times, do not want to be a pit again,

First enable the MCrypt software to run, then install the PHP extension module and configure it in php.ini.

Note here that the MCrypt software relies on the Libmcrypt and Mhash two libraries, so the installation configuration sequence is right-to-left

Download and install MCrypt

1. First go to http://www.sourceforge.net to download the Libmcrypt,mhash,mcrypt installation package, here is the link I found

Libmcrypt (libmcrypt-2.5.8.tar.gz):

http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91774&release_id=487459

MCrypt (mcrypt-2.6.8.tar.gz):

Http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91948&release_id=642101


Mhash (mhash-0.9.9.9.tar.gz):
http://sourceforge.net/project/showfiles.php?group_id=4286&package_id=4300&release_id=645636

2. Install Libmcrypt First

#tar-ZXVF libmcrypt-2.5.8.tar.gz

#cd libmcrypt-2.5.8

#./configure

#make

#make Install

Description: Libmcript is installed by default on/usr/local

3. Installing Mhash

#tar-ZXVF mhash-0.9.9.9.tar.gz

#cd mhash-0.9.9.9

#./configure

#make

#make Install

4. Installing MCrypt

#tar-ZXVF mcrypt-2.6.8.tar.gz

#cd mcrypt-2.6.8

#LD_LIBRARY_PATH =/usr/local/lib/./configure-with-libmcrypt-prefix=/usr/local

#make

#make Install

Description: Because Libmcrypt's link library could not be found when configuring MCrypt, it could not be compiled because the Libmcrypt link library is under the/usr/local/folder. Because you want to add ld_library_path=/usr/local import key Library when configuring MCrypt,

Sometimes there are errors on your Mac when make: Rfc2440.c:26:20:error:malloc.h:no such file or directory, modifying rfc2440.c: #include <malloc.h> for # Include <sys/malloc.h>, make/make install again, such as on MAC10.9 system problem mcrypt fatal error: ' php.h ' File not found, later detailed

5. Generate the Mcypt.so file

    • Download and unzip the PHP source file php-5.3.4.tar.gz (must be the same as the system PHP version number). The PHP version preinstalled in Mac OS X 10.6.3 is 5.3.4, so you need to download this version.
    • Execute the following command at the terminal:
      Tar zxvf php-5.3.4.tar.gz
      CD Php-5.3.4/ext/mcrypt
      Phpize (if the./configure cannot perform the first download autoconf.tar.gz decompression in the autoconf folder directory./configure then make && make install After you install autoconf, you can use it in the PHP folder./configure configuration PHP, such as this does not fit, the following details)
      ./configure
      Make
      sudo cp modules/mcrypt.so/usr/lib/php/extensions/no-debug-non-zts-20090626/
    • Open php.ini
      sudo vi/etc/php.ini
      In Usr/etc/php.ini, add the following code, save and then exit, and then restart Apache (if you do not copy php.ini.default, sometimes to modify Write permissions: chmod 777 php.ini)
      The extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so is over here.

      Note: When upgrading Mac system to 10.9 (Mavericks), install PHP extension problem Resolution

      In the loaded MCrypt plugin times wrong, hint: MCrypt fatal error: ' php.h ' File not found,

      And then carefully again after the loss of the Phpize carriage return has begun to error, the error message is as follows:

      grep:/usr/include/php/main/php.h:no such file or directory

      grep:/usr/include/php/zend/zend_modules.h:no such file or directory

      grep:/usr/include/php/zend/zend_extensions.h:no such file or directory

      Configuring for:

      PHP Api Version:

      Zend Module Api No:

      Zend Extension Api No:

      Workaround:

      sudo ln-s/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.9.sdk/usr /include/usr/include

      If the autoconf is not installed, refer to: http://www.mattvsworld.com/blog/2010/02/ install-the-latest-autoconf-and-automake-on-mac-os-10-6/installation of these 4:1.curl-o http://mirrors.kernel.org/gnu/m4/ M4-1.4.13.tar.gz
      TAR-XZVF m4-1.4.13.tar.gz
      CD m4-1.4.13
      ./configure--prefix=/usr/local
      Make
      sudo make install
      Cd..
      2.curl-o http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
      TAR-XZVF autoconf-2.65.tar.gz
      CD autoconf-2.65
      ./configure--prefix=/usr/local # Ironic, isn ' t it?
      Make
      sudo make install
      Cd.. # Here's might want to restart your terminal session, to ensure the new autoconf are picked up and used in the rest of th E script

      3.curl-o http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
      Tar xzvf automake-1.11.tar.gz
      CD automake-1.11
      ./configure--prefix=/usr/local
      Make
      sudo make install
      Cd..
      4.curl-o http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
      Tar xzvf libtool-2.2.6b.tar.gz
      CD libtool-2.2.6b
      ./configure--prefix=/usr/local
      Make
      sudo make install

< pro-Test to >mac OS Installation mcrypt extension

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.