Ask MCrypt how to install PHP under Mac OS

Source: Internet
Author: User
Tags mcrypt php source code zts

Installation method One:

    • Installation of MCrypt via homebrew, successful installation
      [Shell] Plain Text view copy code
      Brew Install MCrypt

MCrypt is a powerful cryptographic algorithm extension library that includes 22 of algorithms.
1: Download and unzip the mcrypt-2.6.8.tar.bz2. (2.6.8 is a version number, you can choose it yourself, but note that the following steps are consistent with the version number you downloaded.) )
2: Execute command on terminal (note the following commands need to install Xcode support):

CD ~/downloads/mcrypt-2.5.8./configure--disable-posix-threads--enable-staticmakesudo make install 

3: Download and unzip the PHP source code, according to their own situation to choose the corresponding version. (Note the PHP version in the following command)
Execute command at Terminal: (see behind if error)

CD ~/downloads/php-5.5.14/ext/mcryptphpize./CONFIGUREMAKECD modulessudo cp mcrypt. so/usr/lib/php /extensions/no-debug-non-zts-20121212/

(CD modules appears after

Build complete.Don‘t forget to run ‘make test‘.

Indicates that the installation was successful. )

4: Open php.ini

sudo vi/etc/php.ini

Add the following code: (note no-debug-non-zts-20121212 version number, if not clear can go to/usr/lib/php/extensions/view)

Extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so

* If the following error occurs with Phpize:

grep: /usr/include/php/main/php.h: No such file or directorygrep: /usr/include/php/Zend/zend_modules.h: No such file or directorygrep: /usr/include/php/Zend/zend_extensions.h: No such file or directoryConfiguring for:PHP Api Version:Zend Module Api No:Zend Extension Api No:Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.

Indicates the need to install autoconf (install view later essays)

* If make appears the following error:

/ext/mcrypt/mcrypt.c:25:10: fatal error: ‘php.h‘ file not found

Execute the following command:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/include*注意MacOSX10.10.sdk修改为自己系统的版本号*




Transferred from: http://segmentfault.com/a/1190000002395906

Ask MCrypt how to install PHP under Mac OS

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.